From 9a763206595ee5ff85bcf7cebb132cdad02d5397 Mon Sep 17 00:00:00 2001 From: mulhern Date: Thu, 27 Mar 2025 10:41:14 -0400 Subject: [PATCH] Allow an unused unsafe in two functions major and minor were unsafe in libc < 0.2.171, but they are now const. Signed-off-by: mulhern --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index a9abcd0..28f5209 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -300,6 +300,7 @@ impl LoopDevice { /// an IO error. #[allow(clippy::unnecessary_cast)] pub fn major(&self) -> io::Result { + #[allow(unused_unsafe)] self.device .metadata() .map(|m| unsafe { libc::major(m.rdev()) }) @@ -314,6 +315,7 @@ impl LoopDevice { /// an IO error. #[allow(clippy::unnecessary_cast)] pub fn minor(&self) -> io::Result { + #[allow(unused_unsafe)] self.device .metadata() .map(|m| unsafe { libc::minor(m.rdev()) })