chore(clippy): enable and fix many stricter lints (#3783)

* chore(clippy): enable and fix many stricter lints

These ensure that the codebase uses more idiomatic, performant, and
concise language constructions.

* chore: make non-Clippy compiler warnings also deny by default
This commit is contained in:
Alejandro González
2025-06-14 02:10:12 +02:00
committed by GitHub
parent 301967d204
commit f84f8c1c2b
106 changed files with 542 additions and 760 deletions

View File

@@ -42,9 +42,8 @@ impl DirectoryInfo {
))
})?;
let config_dir = config_dir
.map(PathBuf::from)
.unwrap_or_else(|| settings_dir.clone());
let config_dir =
config_dir.map_or_else(|| settings_dir.clone(), PathBuf::from);
Ok(Self {
settings_dir,
@@ -193,8 +192,7 @@ impl DirectoryInfo {
let move_dir = settings
.custom_dir
.as_ref()
.map(PathBuf::from)
.unwrap_or_else(|| app_dir.clone());
.map_or_else(|| app_dir.clone(), PathBuf::from);
async fn is_dir_writeable(
new_config_dir: &Path,
@@ -220,7 +218,7 @@ impl DirectoryInfo {
let disks = sysinfo::Disks::new_with_refreshed_list();
for disk in disks.iter() {
for disk in &disks {
if path.starts_with(disk.mount_point()) {
return Ok(Some(disk.available_space()));
}