From a3fe7b2abc0cef7fa7e764e50adebd6ffc6be005 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 26 Aug 2025 08:20:38 -0400 Subject: [PATCH] crates/blockdev: Fix various clippy lints Signed-off-by: Colin Walters --- crates/blockdev/src/blockdev.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/blockdev/src/blockdev.rs b/crates/blockdev/src/blockdev.rs index d46d6b81..ceed18d9 100644 --- a/crates/blockdev/src/blockdev.rs +++ b/crates/blockdev/src/blockdev.rs @@ -49,7 +49,7 @@ impl Device { #[allow(dead_code)] pub fn has_children(&self) -> bool { - self.children.as_ref().map_or(false, |v| !v.is_empty()) + self.children.as_ref().is_some_and(|v| !v.is_empty()) } // The "start" parameter was only added in a version of util-linux that's only @@ -451,7 +451,7 @@ mod test { #[test] fn test_parse_lsblk() { let fixture = include_str!("../tests/fixtures/lsblk.json"); - let devs: DevicesOutput = serde_json::from_str(&fixture).unwrap(); + let devs: DevicesOutput = serde_json::from_str(fixture).unwrap(); let dev = devs.blockdevices.into_iter().next().unwrap(); let children = dev.children.as_deref().unwrap(); assert_eq!(children.len(), 3); @@ -498,7 +498,7 @@ mod test { } } "# }; - let table: SfDiskOutput = serde_json::from_str(&fixture).unwrap(); + let table: SfDiskOutput = serde_json::from_str(fixture).unwrap(); assert_eq!( table.partitiontable.find("/dev/loop0p2").unwrap().size, 20961247