Skip to content

Commit f8bf605

Browse files
committed
refactor(hdd): rename single-letter closure variables to descriptive names
https://claude.ai/code/session_01MHKaZm6DcA9kjBPnW3KN5K
1 parent 504996c commit f8bf605

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/app/hdd/test_linux.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ macro_rules! identity_reclassify_test_case {
7171
path.to_path_buf().pipe(Ok)
7272
}
7373
fn path_exists(path: &Path) -> bool {
74-
DEVICES.iter().any(|p| path == Path::new(*p))
74+
DEVICES.iter().any(|dev| path == Path::new(*dev))
7575
}
7676
fn read_link(path: &Path) -> io::Result<PathBuf> {
7777
DRIVERS
7878
.iter()
79-
.find(|(p, _)| path == Path::new(*p))
79+
.find(|(drv_path, _)| path == Path::new(*drv_path))
8080
.map(|(_, driver)| PathBuf::from(format!("/drivers/{driver}")))
8181
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "mocked"))
8282
}
@@ -181,17 +181,17 @@ fn test_mapper_symlink_resolves_to_virtual_partition() {
181181
fn canonicalize(path: &Path) -> io::Result<PathBuf> {
182182
[("/dev/mapper/vg0-lv0", "/dev/vda1")]
183183
.iter()
184-
.find(|(p, _)| path == Path::new(*p))
184+
.find(|(src, _)| path == Path::new(*src))
185185
.map(|(_, target)| PathBuf::from(*target))
186186
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "mocked"))
187187
}
188188
fn path_exists(path: &Path) -> bool {
189-
["/sys/block/vda"].iter().any(|p| path == Path::new(*p))
189+
["/sys/block/vda"].iter().any(|dev| path == Path::new(*dev))
190190
}
191191
fn read_link(path: &Path) -> io::Result<PathBuf> {
192192
[("/sys/block/vda/device/driver", "virtio_blk")]
193193
.iter()
194-
.find(|(p, _)| path == Path::new(*p))
194+
.find(|(drv_path, _)| path == Path::new(*drv_path))
195195
.map(|(_, driver)| PathBuf::from(format!("/drivers/{driver}")))
196196
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "mocked"))
197197
}
@@ -215,7 +215,7 @@ fn test_mapper_dm_device_is_not_corrected() {
215215
fn canonicalize(path: &Path) -> io::Result<PathBuf> {
216216
[("/dev/mapper/vg0-lv0", "/dev/dm-0")]
217217
.iter()
218-
.find(|(p, _)| path == Path::new(*p))
218+
.find(|(src, _)| path == Path::new(*src))
219219
.map(|(_, target)| PathBuf::from(*target))
220220
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, "mocked"))
221221
}

0 commit comments

Comments
 (0)