comparison rust/hg-core/src/dirstate_tree/dirstate_map.rs @ 49923:547d6817e0c3

rust-clippy: add `is_empty` method to please the `clippy` gods I can see it being useful anyway.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 09 Jan 2023 18:27:53 +0100
parents b6dc4802e7ef
children 66ffe3749a48
comparison
equal deleted inserted replaced
49922:b6dc4802e7ef 49923:547d6817e0c3
1378 pub fn len(&self) -> usize { 1378 pub fn len(&self) -> usize {
1379 let map = self.get_map(); 1379 let map = self.get_map();
1380 map.nodes_with_entry_count as usize 1380 map.nodes_with_entry_count as usize
1381 } 1381 }
1382 1382
1383 pub fn is_empty(&self) -> bool {
1384 self.len() == 0
1385 }
1386
1383 pub fn contains_key( 1387 pub fn contains_key(
1384 &self, 1388 &self,
1385 key: &HgPath, 1389 key: &HgPath,
1386 ) -> Result<bool, DirstateV2ParseError> { 1390 ) -> Result<bool, DirstateV2ParseError> {
1387 Ok(self.get(key)?.is_some()) 1391 Ok(self.get(key)?.is_some())