rust-clippy: tell clippy we care about keeping those `if` clauses separate
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 09 Jan 2023 18:04:29 +0100
changeset 49918 4158608f7786
parent 49917 4c71c215bcfe
child 49919 bd42bd6eae45
rust-clippy: tell clippy we care about keeping those `if` clauses separate Thses were written this way because it spells out the logic in a more explicit manner.
rust/hg-core/src/dirstate/entry.rs
--- a/rust/hg-core/src/dirstate/entry.rs	Mon Jan 09 18:03:24 2023 +0100
+++ b/rust/hg-core/src/dirstate/entry.rs	Mon Jan 09 18:04:29 2023 +0100
@@ -422,6 +422,7 @@
     }
 
     pub fn maybe_clean(&self) -> bool {
+        #[allow(clippy::if_same_then_else)]
         if !self.flags.contains(Flags::WDIR_TRACKED) {
             false
         } else if !self.flags.contains(Flags::P1_TRACKED) {
@@ -511,6 +512,8 @@
             // TODO: return an Option instead?
             panic!("Accessing v1_mtime of an untracked DirstateEntry")
         }
+
+        #[allow(clippy::if_same_then_else)]
         if self.removed() {
             0
         } else if self.flags.contains(Flags::P2_INFO) {