mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Implement simple clippy suggestions (#159)
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ pub(crate) struct Game {
|
||||
impl From<Game> for ShortcutOwned {
|
||||
fn from(game: Game) -> Self {
|
||||
let launch = format!("\"uplay://launch/{}/0\"", game.id);
|
||||
let start_dir = game.launcher.parent().unwrap_or(Path::new("")).to_string_lossy();
|
||||
let start_dir = game.launcher.parent().unwrap_or_else(|| {Path::new("")}).to_string_lossy();
|
||||
let exe = format!("\"{}\"",game.launcher.to_string_lossy());
|
||||
Shortcut::new("0", &game.name, &exe, &start_dir, &game.icon, "", &launch).to_owned()
|
||||
}
|
||||
|
||||
@@ -29,18 +29,18 @@ impl Platform<Game, Box<dyn Error>> for Uplay {
|
||||
#[cfg(target_family = "unix")]
|
||||
{
|
||||
//Linux not supported yet
|
||||
return crate::platform::SettingsValidity::Invalid {
|
||||
crate::platform::SettingsValidity::Invalid {
|
||||
reason: "Linux not supported yet".to_string(),
|
||||
};
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
if get_launcher_path().is_some() {
|
||||
return crate::platform::SettingsValidity::Valid;
|
||||
crate::platform::SettingsValidity::Valid
|
||||
} else {
|
||||
return crate::platform::SettingsValidity::Invalid {
|
||||
crate::platform::SettingsValidity::Invalid {
|
||||
reason: "Could not find UPlay instalation".to_string(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,7 @@ fn get_launcher_path() -> Option<PathBuf> {
|
||||
if let Ok(launcher_dir) = launcher_dir {
|
||||
let path = Path::new(&launcher_dir).join("upc.exe");
|
||||
if path.exists() {
|
||||
return Some(path.to_path_buf());
|
||||
return Some(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user