Skip to content

Commit 690975c

Browse files
committed
refactor(hdd): rename is_in_hdd to is_hdd and fix macro capture variable
`is_in_hdd` checks whether a disk IS an HDD, not whether something is IN an HDD — rename to `is_hdd`. Also rename the leftover `$mount` macro capture variable to `$disk_name` to match its parameter name. https://claude.ai/code/session_01MHKaZm6DcA9kjBPnW3KN5K
1 parent 195d3a2 commit 690975c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/hdd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ fn path_is_in_hdd<Disk: DiskApi, Fs: FsApi>(path: &Path, disks: &[Disk]) -> bool
262262
disks
263263
.iter()
264264
.filter(|disk| disk.get_mount_point() == mount_point)
265-
.any(|disk| is_in_hdd::<Fs>(disk))
265+
.any(|disk| is_hdd::<Fs>(disk))
266266
}
267267

268268
/// Check if a disk is an HDD after applying platform-specific corrections.
269-
fn is_in_hdd<Fs: FsApi>(disk: &impl DiskApi) -> bool {
269+
fn is_hdd<Fs: FsApi>(disk: &impl DiskApi) -> bool {
270270
let kind = disk.get_disk_kind();
271271
let name = disk.get_disk_name().to_str();
272272
match name {

src/app/hdd/test_linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ macro_rules! identity_reclassify_test_case {
5555
$name:ident where
5656
block_device = $block:literal,
5757
driver = $driver:literal,
58-
disk_name = $mount:literal,
58+
disk_name = $disk_name:literal,
5959
expected = $expected:expr,
6060
) => {
6161
$(#[$attr])*
@@ -83,7 +83,7 @@ macro_rules! identity_reclassify_test_case {
8383
}
8484

8585
assert_eq!(
86-
reclassify_virtual_hdd::<Fs>(DiskKind::HDD, $mount),
86+
reclassify_virtual_hdd::<Fs>(DiskKind::HDD, $disk_name),
8787
$expected,
8888
);
8989
}

0 commit comments

Comments
 (0)