diff --git a/src/egs/get_manifests.rs b/src/egs/get_manifests.rs index 3a276ec..6b9a7a6 100644 --- a/src/egs/get_manifests.rs +++ b/src/egs/get_manifests.rs @@ -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(); diff --git a/src/egs/paths.rs b/src/egs/paths.rs index 21a30b0..ae0d77b 100644 --- a/src/egs/paths.rs +++ b/src/egs/paths.rs @@ -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, }); } diff --git a/src/flatpak/platform.rs b/src/flatpak/platform.rs index 1b51217..b4c8009 100644 --- a/src/flatpak/platform.rs +++ b/src/flatpak/platform.rs @@ -44,7 +44,7 @@ impl Platform> 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 { diff --git a/src/gog/gog_platform.rs b/src/gog/gog_platform.rs index 416c130..247ddf3 100644 --- a/src/gog/gog_platform.rs +++ b/src/gog/gog_platform.rs @@ -174,7 +174,7 @@ impl Platform for GogPlatform { match shortcuts_res { Ok(_) => SettingsValidity::Valid, Err(err) => SettingsValidity::Invalid { - reason: format!("{}", err), + reason: err.to_string(), }, } } diff --git a/src/heroic/heroic_game_type.rs b/src/heroic/heroic_game_type.rs index e6042ec..ed39562 100644 --- a/src/heroic/heroic_game_type.rs +++ b/src/heroic/heroic_game_type.rs @@ -25,7 +25,7 @@ impl HeroicGameType { title, app_name, install_mode, - } => &app_name, + } => app_name, } } diff --git a/src/itch/itch_platform.rs b/src/itch/itch_platform.rs index 72ed69c..b69b1a5 100644 --- a/src/itch/itch_platform.rs +++ b/src/itch/itch_platform.rs @@ -63,7 +63,7 @@ impl Platform for ItchPlatform { match shortcuts_res { Ok(_) => SettingsValidity::Valid, Err(err) => SettingsValidity::Invalid { - reason: format!("{}", err), + reason: err.to_string(), }, } } diff --git a/src/lutris/game_list_parser.rs b/src/lutris/game_list_parser.rs index b3d8c16..13fd3de 100644 --- a/src/lutris/game_list_parser.rs +++ b/src/lutris/game_list_parser.rs @@ -1,14 +1,10 @@ use super::lutris_game::LutrisGame; pub fn parse_lutris_games(input: &str) -> Vec { - let games = serde_json::from_str::>(&input); + let games = serde_json::from_str::>(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] diff --git a/src/origin/origin_platform.rs b/src/origin/origin_platform.rs index 4f53d6b..191e1b4 100644 --- a/src/origin/origin_platform.rs +++ b/src/origin/origin_platform.rs @@ -66,7 +66,7 @@ impl Platform 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 { 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); } }