aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-03-27 18:18:29 +0200
committerGitHub <noreply@github.com>2023-03-27 16:18:29 +0000
commit7d5e7b5b6b83ba9ab80f9be984c0d455b51b6502 (patch)
tree282b14956ebe72690582976cd186b23d44619132
parent4cdfc0ea04844681de078d26f44321cb3c3b05c5 (diff)
downloadFlightCore-7d5e7b5b6b83ba9ab80f9be984c0d455b51b6502.tar.gz
FlightCore-7d5e7b5b6b83ba9ab80f9be984c0d455b51b6502.zip
fix: Replace `<=0` with `.is_empty()` (#244)
-rw-r--r--src-tauri/src/mod_management/mod.rs4
-rw-r--r--src-tauri/src/repair_and_verify/mod.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index 41b2c13b..0c0389c8 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -328,7 +328,7 @@ pub async fn fc_download_mod_and_install(
let mods_directory = format!("{}/R2Northstar/mods/", game_install.game_path);
// Early return on empty string
- if thunderstore_mod_string.len() == 0 {
+ if thunderstore_mod_string.is_empty() {
return Err("Passed empty string".to_string());
}
@@ -483,7 +483,7 @@ pub fn delete_thunderstore_mod(
}
}
- if !(mod_folders_to_remove.len() > 0) {
+ if !mod_folders_to_remove.is_empty() {
return Err(format!(
"No mods removed as no Northstar mods matching {thunderstore_mod_string} were found to be installed."
));
diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs
index 9d020f15..31b31040 100644
--- a/src-tauri/src/repair_and_verify/mod.rs
+++ b/src-tauri/src/repair_and_verify/mod.rs
@@ -84,7 +84,7 @@ pub fn get_log_list(game_install: GameInstall) -> Result<Vec<std::path::PathBuf>
}
}
- if log_files.len() > 0 {
+ if !log_files.is_empty() {
Ok(log_files)
} else {
Err("No logs found".to_string())