mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Clean up clippy suggestions
This commit is contained in:
@@ -43,7 +43,7 @@ impl Platform<GogShortcut, GogErrors> for GogPlatform {
|
|||||||
let install_locations = get_install_locations(config_path)?;
|
let install_locations = get_install_locations(config_path)?;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let install_locations = if let Some(wine_c_drive) = &self.settings.wine_c_drive {
|
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 {
|
} else {
|
||||||
install_locations
|
install_locations
|
||||||
};
|
};
|
||||||
@@ -141,12 +141,12 @@ impl Platform<GogShortcut, GogErrors> for GogPlatform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn fix_paths(wine_c_drive: &String, paths: Vec<String>) -> Vec<String> {
|
fn fix_paths(wine_c_drive: &str, paths: Vec<String>) -> Vec<String> {
|
||||||
paths
|
paths
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|path| {
|
.flat_map(|path| {
|
||||||
if path.starts_with("C:\\") {
|
if let Some(stripped) = path.strip_prefix("C:\\") {
|
||||||
let path_buf = Path::new(wine_c_drive).join(&path[3..]);
|
let path_buf = Path::new(wine_c_drive).join(stripped);
|
||||||
path_buf.to_str().map(|s| s.to_string().replace("\\", "/"))
|
path_buf.to_str().map(|s| s.to_string().replace("\\", "/"))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ pub fn create_sym_links(shortcut: &ShortcutOwned) -> ShortcutOwned {
|
|||||||
0,
|
0,
|
||||||
shortcut.app_name.as_str(),
|
shortcut.app_name.as_str(),
|
||||||
exe.as_str(),
|
exe.as_str(),
|
||||||
&start_dir.as_str(),
|
start_dir.as_str(),
|
||||||
icon.as_str(),
|
icon.as_str(),
|
||||||
shortcut.shortcut_path.as_str(),
|
shortcut.shortcut_path.as_str(),
|
||||||
shortcut.launch_options.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 {}",
|
"Could not create links folder for symlinks at path: {:?} , error: {:?} , you can try to disable creating symlinks for platform {}",
|
||||||
boilr_links_path, e, name
|
boilr_links_path, e, name
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user