Implement simple clippy suggestions (#159)

This commit is contained in:
Philip Kristoffersen
2022-05-27 13:19:10 +02:00
committed by GitHub
parent c57a7ec4a2
commit 835c7ead8d
12 changed files with 79 additions and 97 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ impl From<OriginGame> for ShortcutOwned {
fn from(game: OriginGame) -> Self {
let launch = match game.origin_compat_folder{
Some(compat_folder) =>
format!("STEAM_COMPAT_DATA_PATH=\"{}\" %command% \"origin2://game/launch?offerIds={}&autoDownload=1&authCode=&cmdParams=\"", compat_folder.to_string_lossy().to_string(), game.id)
format!("STEAM_COMPAT_DATA_PATH=\"{}\" %command% \"origin2://game/launch?offerIds={}&autoDownload=1&authCode=&cmdParams=\"", compat_folder.to_string_lossy(), game.id)
,
None => format!(
"\"origin2://game/launch?offerIds={}&autoDownload=1&authCode=&cmdParams=\"",
+6 -5
View File
@@ -174,10 +174,11 @@ fn get_default_locations() -> Option<OriginPathData> {
return None;
}
let exe_path = get_exe_path();
if exe_path.is_none() {
return None;
} else {
res.exe_path = exe_path.unwrap();
match exe_path {
Some(exe_path) => {
res.exe_path = exe_path;
}
None => return None,
}
}
Some(res)
@@ -194,7 +195,7 @@ fn get_exe_path() -> Option<PathBuf> {
let launcher_string: Result<String, _> = launcher_key.get_value("");
if let Ok(launcher_string) = launcher_string {
let path = Path::new(&launcher_string[1..launcher_string.len() - 6]);
println!("{:?}",path);
println!("{:?}", path);
if path.exists() {
return Some(path.to_path_buf());
}