diff --git a/src/io/writeback/linux.rs b/src/io/writeback/linux.rs index e7bd3d9..0d1ede3 100644 --- a/src/io/writeback/linux.rs +++ b/src/io/writeback/linux.rs @@ -321,8 +321,12 @@ fn detect_nfs(fd: RawFd) -> bool { } // `f_type` is signed (`__fsword_t`) on glibc and unsigned // (`c_ulong`) on musl. Cast both sides to i64 for a portable - // comparison. + // comparison. On glibc x86_64 both already are i64 — clippy flags + // the cast as unnecessary on that target only, but we need it for + // musl, so silence the lint. + #[allow(clippy::unnecessary_cast)] let f_type = buf.f_type as i64; + #[allow(clippy::unnecessary_cast)] let nfs_magic = libc::NFS_SUPER_MAGIC as i64; f_type == nfs_magic } diff --git a/src/mux/m2ts_mux/packet.rs b/src/mux/m2ts_mux/packet.rs index 0d6c607..81ca3ba 100644 --- a/src/mux/m2ts_mux/packet.rs +++ b/src/mux/m2ts_mux/packet.rs @@ -57,11 +57,11 @@ impl Packet { /// Append the adaptation field after the header. /// - /// `body` is the adaptation field body (flags byte + optional PCR - /// + …). `stuffing` is the number of `0xFF` stuffing bytes to + /// `body` is the adaptation field body (flags byte plus optional PCR + /// and so on). `stuffing` is the number of `0xFF` stuffing bytes to /// append after the body. The first byte of the field - /// (`adaptation_field_length`) is computed here from `body.len() + - /// stuffing`. + /// (`adaptation_field_length`) is computed here from + /// `body.len() + stuffing`. pub(super) fn append_adaptation(&mut self, body: &[u8], stuffing: usize) { let af_len = body.len() + stuffing; debug_assert!(af_len <= 183, "adaptation field overflow"); diff --git a/src/platform/fs_type/linux.rs b/src/platform/fs_type/linux.rs index 26d2969..591018e 100644 --- a/src/platform/fs_type/linux.rs +++ b/src/platform/fs_type/linux.rs @@ -32,8 +32,12 @@ pub(super) fn detect_impl(path: &Path) -> FsType { } // `f_type` is signed (`__fsword_t`) on glibc and unsigned // (`c_ulong`) on musl. Cast both sides to i64 for a portable - // comparison. + // comparison. On glibc x86_64 both already are i64 — clippy flags + // the cast as unnecessary on that target only, but we need it for + // musl, so silence the lint. + #[allow(clippy::unnecessary_cast)] let f_type = buf.f_type as i64; + #[allow(clippy::unnecessary_cast)] let nfs_magic = libc::NFS_SUPER_MAGIC as i64; if f_type == nfs_magic { return FsType::Nfs;