mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Minor refactors based on cargo clippy
This commit is contained in:
@@ -27,7 +27,7 @@ pub(crate) fn get_egs_manifests(
|
||||
manifest.manifest_location = compat_folder
|
||||
.join("pfx")
|
||||
.join("drive_c")
|
||||
.join(&manifest.manifest_location[3..].replace("\\", "/"))
|
||||
.join(&manifest.manifest_location[3..].replace('\\', "/"))
|
||||
.to_path_buf()
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
@@ -35,7 +35,7 @@ pub(crate) fn get_egs_manifests(
|
||||
manifest.install_location = compat_folder
|
||||
.join("pfx")
|
||||
.join("drive_c")
|
||||
.join(&manifest.install_location[3..].replace("\\", "/"))
|
||||
.join(&manifest.install_location[3..].replace('\\', "/"))
|
||||
.to_path_buf()
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ mod unix {
|
||||
//We found all we need
|
||||
return Some(EpicPaths {
|
||||
launcher_path,
|
||||
compat_folder_path: Some(dir.path().to_path_buf()),
|
||||
compat_folder_path: Some(dir.path()),
|
||||
manifest_folder_path,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ impl Platform<FlatpakApp, Box<dyn Error>> for FlatpakPlatform {
|
||||
let output_string = String::from_utf8_lossy(&output.stdout).to_string();
|
||||
let mut result = vec![];
|
||||
for line in output_string.lines() {
|
||||
let mut split = line.split("\t");
|
||||
let mut split = line.split('\t');
|
||||
if let Some(name) = split.next() {
|
||||
if let Some(id) = split.next() {
|
||||
result.push(FlatpakApp {
|
||||
|
||||
@@ -174,7 +174,7 @@ impl Platform<GogShortcut, String> for GogPlatform {
|
||||
match shortcuts_res {
|
||||
Ok(_) => SettingsValidity::Valid,
|
||||
Err(err) => SettingsValidity::Invalid {
|
||||
reason: format!("{}", err),
|
||||
reason: err.to_string(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ impl HeroicGameType {
|
||||
title,
|
||||
app_name,
|
||||
install_mode,
|
||||
} => &app_name,
|
||||
} => app_name,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ impl Platform<ItchGame, String> for ItchPlatform {
|
||||
match shortcuts_res {
|
||||
Ok(_) => SettingsValidity::Valid,
|
||||
Err(err) => SettingsValidity::Invalid {
|
||||
reason: format!("{}", err),
|
||||
reason: err.to_string(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
use super::lutris_game::LutrisGame;
|
||||
|
||||
pub fn parse_lutris_games(input: &str) -> Vec<LutrisGame> {
|
||||
let games = serde_json::from_str::<Vec<LutrisGame>>(&input);
|
||||
let games = serde_json::from_str::<Vec<LutrisGame>>(input);
|
||||
match games {
|
||||
Ok(games) => {
|
||||
return games
|
||||
}
|
||||
Err(_err) => {
|
||||
return Vec::new()
|
||||
}
|
||||
Ok(games) => games,
|
||||
Err(_err) => Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +36,10 @@ mod tests {
|
||||
|
||||
let games = parse_lutris_games(content);
|
||||
|
||||
assert_eq!(games[5].name, "The Witcher 3: Wild Hunt - Game of the Year Edition");
|
||||
assert_eq!(
|
||||
games[5].name,
|
||||
"The Witcher 3: Wild Hunt - Game of the Year Edition"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -49,7 +48,10 @@ mod tests {
|
||||
|
||||
let games = parse_lutris_games(content);
|
||||
|
||||
assert_eq!(games[5].slug, "the-witcher-3-wild-hunt-game-of-the-year-edition");
|
||||
assert_eq!(
|
||||
games[5].slug,
|
||||
"the-witcher-3-wild-hunt-game-of-the-year-edition"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -66,7 +66,7 @@ impl Platform<OriginGame, String> for OriginPlatform {
|
||||
match shortcuts_res {
|
||||
Ok(_) => SettingsValidity::Valid,
|
||||
Err(err) => SettingsValidity::Invalid {
|
||||
reason: format!("{}", err),
|
||||
reason: err.to_string(),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ fn get_default_locations() -> Option<OriginPathData> {
|
||||
if origin_exe_path.exists() && origin_local_content.exists() {
|
||||
res.exe_path = origin_exe_path;
|
||||
res.local_content_path = origin_local_content;
|
||||
res.compat_folder = Some(dir.path().to_path_buf());
|
||||
res.compat_folder = Some(dir.path());
|
||||
return Some(res);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user