rust-clippy: ignore clippy's recommendation for "useless" cast
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 06 Nov 2023 11:02:18 +0100
changeset 51119 d58e754f2db0
parent 51118 98910135a3bc
child 51120 532e74ad3ff6
rust-clippy: ignore clippy's recommendation for "useless" cast See explanation inline.
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;