rust-clippy: add `is_empty` method to please the `clippy` gods
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 09 Jan 2023 18:27:53 +0100
changeset 49996 547d6817e0c3
parent 49995 b6dc4802e7ef
child 49997 66ffe3749a48
rust-clippy: add `is_empty` method to please the `clippy` gods I can see it being useful anyway.
rust/hg-core/src/dirstate_tree/dirstate_map.rs
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Mon Jan 09 18:25:24 2023 +0100
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Mon Jan 09 18:27:53 2023 +0100
@@ -1380,6 +1380,10 @@
         map.nodes_with_entry_count as usize
     }
 
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
     pub fn contains_key(
         &self,
         key: &HgPath,