remove recently-made-unnecessary unsafe block

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-03-30 01:58:14 +00:00
parent bee4c6255a
commit db99d3a001

View file

@ -123,10 +123,7 @@ pub fn dev_from_path(path: &Path) -> Result<(dev_t, dev_t)> {
let stat = fs::metadata(path)?;
let dev_id = stat.dev().try_into()?;
// SAFETY: These functions may not need to be marked as unsafe.
// see: https://github.com/rust-lang/libc/issues/3759
let (major, minor) = unsafe { (libc::major(dev_id), libc::minor(dev_id)) };
let (major, minor) = (libc::major(dev_id), libc::minor(dev_id));
Ok((major.try_into()?, minor.try_into()?))
}