diff --git a/src/gog/gog_platform.rs b/src/gog/gog_platform.rs index 43d41bc..a7b3d39 100644 --- a/src/gog/gog_platform.rs +++ b/src/gog/gog_platform.rs @@ -43,7 +43,7 @@ impl Platform for GogPlatform { let install_locations = get_install_locations(config_path)?; #[cfg(target_os = "linux")] let install_locations = if let Some(wine_c_drive) = &self.settings.wine_c_drive { - fix_paths(&wine_c_drive, install_locations) + fix_paths(wine_c_drive, install_locations) } else { install_locations }; @@ -141,12 +141,12 @@ impl Platform for GogPlatform { } #[cfg(target_os = "linux")] -fn fix_paths(wine_c_drive: &String, paths: Vec) -> Vec { +fn fix_paths(wine_c_drive: &str, paths: Vec) -> Vec { paths .iter() .flat_map(|path| { - if path.starts_with("C:\\") { - let path_buf = Path::new(wine_c_drive).join(&path[3..]); + if let Some(stripped) = path.strip_prefix("C:\\") { + let path_buf = Path::new(wine_c_drive).join(stripped); path_buf.to_str().map(|s| s.to_string().replace("\\", "/")) } else { None diff --git a/src/sync/symlinks.rs b/src/sync/symlinks.rs index b73e70a..2a85fb3 100644 --- a/src/sync/symlinks.rs +++ b/src/sync/symlinks.rs @@ -36,7 +36,7 @@ pub fn create_sym_links(shortcut: &ShortcutOwned) -> ShortcutOwned { 0, shortcut.app_name.as_str(), exe.as_str(), - &start_dir.as_str(), + start_dir.as_str(), icon.as_str(), shortcut.shortcut_path.as_str(), shortcut.launch_options.as_str(), @@ -60,7 +60,6 @@ pub fn ensure_links_folder_created(name: &str) { "Could not create links folder for symlinks at path: {:?} , error: {:?} , you can try to disable creating symlinks for platform {}", boilr_links_path, e, name ); - return; } } }