Skip to content
This repository was archived by the owner on Jun 29, 2026. It is now read-only.

Commit 8b5c1bb

Browse files
committed
refactor: Use idiomatic empty check for disk collection
Replace `into_iter().next().is_none()` with `list().is_empty()` for clarity, and use `list().iter()` for the actual collection.
1 parent 104767c commit 8b5c1bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/system_information/disk.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ impl Disk {
1212
#[tracing::instrument(name = "Disk::collect_all")]
1313
pub fn collect_all() -> Vec<Self> {
1414
let disks = sysinfo::Disks::new_with_refreshed_list();
15-
if disks.into_iter().next().is_none() {
15+
if disks.list().is_empty() {
1616
tracing::info!("no disks found");
1717
}
18-
disks.into_iter().map(Self::from).collect()
18+
disks.list().iter().map(Self::from).collect()
1919
}
2020
}
2121

0 commit comments

Comments
 (0)