Skip to content

Commit 9a76320

Browse files
committed
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 <amulhern@redhat.com>
1 parent 4d5e734 commit 9a76320

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ impl LoopDevice {
300300
/// an IO error.
301301
#[allow(clippy::unnecessary_cast)]
302302
pub fn major(&self) -> io::Result<u32> {
303+
#[allow(unused_unsafe)]
303304
self.device
304305
.metadata()
305306
.map(|m| unsafe { libc::major(m.rdev()) })
@@ -314,6 +315,7 @@ impl LoopDevice {
314315
/// an IO error.
315316
#[allow(clippy::unnecessary_cast)]
316317
pub fn minor(&self) -> io::Result<u32> {
318+
#[allow(unused_unsafe)]
317319
self.device
318320
.metadata()
319321
.map(|m| unsafe { libc::minor(m.rdev()) })

0 commit comments

Comments
 (0)