Skip to content

Commit 03faf48

Browse files
committed
Bugfix: clippy::unnecessary_sort_by on Linux volume sorting
Bumped clippy 1.95 flags three pre-existing sort_by(|a,b| ... cmp(...)) calls in volumes_linux/mod.rs as unnecessary_sort_by. Switched to sort_by_key(|v| v.name.to_lowercase()). Cfg-gated for Linux so verified by CI on Linux, not locally.
1 parent d676efa commit 03faf48

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • apps/desktop/src-tauri/src/volumes_linux

apps/desktop/src-tauri/src/volumes_linux/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ pub fn get_mounted_volumes(mounts: &[MountEntry]) -> Vec<LocationInfo> {
338338
});
339339
}
340340

341-
volumes.sort_by(|a, b| a.name.to_lowercase().cmp(&b.name.to_lowercase()));
341+
volumes.sort_by_key(|v| v.name.to_lowercase());
342342
volumes
343343
}
344344

@@ -375,7 +375,7 @@ fn get_cloud_drives(mounts: &[MountEntry]) -> Vec<LocationInfo> {
375375
}
376376
}
377377

378-
drives.sort_by(|a, b| a.name.to_lowercase().cmp(&b.name.to_lowercase()));
378+
drives.sort_by_key(|d| d.name.to_lowercase());
379379
drives
380380
}
381381

@@ -443,7 +443,7 @@ fn get_network_mounts() -> Vec<LocationInfo> {
443443
}
444444
}
445445

446-
mounts.sort_by(|a, b| a.name.to_lowercase().cmp(&b.name.to_lowercase()));
446+
mounts.sort_by_key(|m| m.name.to_lowercase());
447447
mounts
448448
}
449449

0 commit comments

Comments
 (0)