|
@@ -458,10 +458,17 @@ impl<'dir> File<'dir> {
|
|
|
else if self.is_char_device() || self.is_block_device() {
|
|
else if self.is_char_device() || self.is_block_device() {
|
|
|
let device_id = self.metadata.rdev();
|
|
let device_id = self.metadata.rdev();
|
|
|
|
|
|
|
|
|
|
+ // MacOS and Linux have different arguments and return types for the
|
|
|
|
|
+ // functions major and minor. On Linux the try_into().unwrap() and
|
|
|
|
|
+ // the "as u32" cast are not needed. We turn off the warning to
|
|
|
|
|
+ // allow it to compile cleanly on Linux.
|
|
|
|
|
+ #[allow(trivial_numeric_casts)]
|
|
|
|
|
+ #[allow(clippy::unnecessary_cast)]
|
|
|
|
|
+ #[allow(clippy::useless_conversion)]
|
|
|
f::Size::DeviceIDs(f::DeviceIDs {
|
|
f::Size::DeviceIDs(f::DeviceIDs {
|
|
|
// SAFETY: Calling libc function to decompose the device_id
|
|
// SAFETY: Calling libc function to decompose the device_id
|
|
|
- major: unsafe { libc::major(device_id.try_into().unwrap()) },
|
|
|
|
|
- minor: unsafe { libc::minor(device_id.try_into().unwrap()) },
|
|
|
|
|
|
|
+ major: unsafe { libc::major(device_id.try_into().unwrap()) } as u32,
|
|
|
|
|
+ minor: unsafe { libc::minor(device_id.try_into().unwrap()) } as u32,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
else if self.is_link() && self.deref_links {
|
|
else if self.is_link() && self.deref_links {
|