# HG changeset patch # User Raphaël Gomès # Date 1699264938 -3600 # Node ID d58e754f2db0fb6507cd7c9068652edc4cf55fde # Parent 98910135a3bccc02796b368e9297713afa87cedc rust-clippy: ignore clippy's recommendation for "useless" cast See explanation inline. diff -r 98910135a3bc -r d58e754f2db0 rust/hg-core/src/dirstate_tree/on_disk.rs --- a/rust/hg-core/src/dirstate_tree/on_disk.rs Mon Nov 06 17:12:04 2023 +0100 +++ b/rust/hg-core/src/dirstate_tree/on_disk.rs Mon Nov 06 11:02:18 2023 +0100 @@ -414,6 +414,8 @@ } fn synthesize_unix_mode(&self) -> u32 { + // Some platforms' libc don't have the same type (MacOS uses i32 here) + #[allow(clippy::unnecessary_cast)] let file_type = if self.flags().contains(Flags::MODE_IS_SYMLINK) { libc::S_IFLNK as u32 } else { @@ -529,6 +531,8 @@ flags.set(Flags::WDIR_TRACKED, wc_tracked); flags.set(Flags::P1_TRACKED, p1_tracked); flags.set(Flags::P2_INFO, p2_info); + // Some platforms' libc don't have the same type (MacOS uses i32 here) + #[allow(clippy::unnecessary_cast)] let size = if let Some((m, s)) = mode_size_opt { let exec_perm = m & (libc::S_IXUSR as u32) != 0; let is_symlink = m & (libc::S_IFMT as u32) == libc::S_IFLNK as u32;