Mercurial > hg
comparison rust/hg-core/src/dirstate_tree/dirstate_map.rs @ 51120:532e74ad3ff6
rust: run a clippy pass with the latest stable version
Our current version of clippy is older than the latest stable.
The newest version has new lints that are moslty good advice, so let's apply
them ahead of time. This has the added benefit of reducing the noise for
developpers like myself that use clippy as an IDE helper, as well as being
more prepared for a future clippy upgrade.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 06 Nov 2023 11:06:08 +0100 |
parents | 264072107105 |
children | ec7171748350 |
comparison
equal
deleted
inserted
replaced
51119:d58e754f2db0 | 51120:532e74ad3ff6 |
---|---|
176 > { | 176 > { |
177 match self { | 177 match self { |
178 ChildNodes::InMemory(nodes) => Ok(nodes), | 178 ChildNodes::InMemory(nodes) => Ok(nodes), |
179 ChildNodes::OnDisk(nodes) => { | 179 ChildNodes::OnDisk(nodes) => { |
180 *unreachable_bytes += | 180 *unreachable_bytes += |
181 std::mem::size_of_val::<[on_disk::Node]>(nodes) as u32; | 181 std::mem::size_of_val::<[on_disk::Node]>(*nodes) as u32; |
182 let nodes = nodes | 182 let nodes = nodes |
183 .iter() | 183 .iter() |
184 .map(|node| { | 184 .map(|node| { |
185 Ok(( | 185 Ok(( |
186 node.path(on_disk)?, | 186 node.path(on_disk)?, |
762 filename: &HgPath, | 762 filename: &HgPath, |
763 old_entry_opt: Option<DirstateEntry>, | 763 old_entry_opt: Option<DirstateEntry>, |
764 ) -> Result<bool, DirstateV2ParseError> { | 764 ) -> Result<bool, DirstateV2ParseError> { |
765 let was_tracked = old_entry_opt.map_or(false, |e| e.tracked()); | 765 let was_tracked = old_entry_opt.map_or(false, |e| e.tracked()); |
766 let had_entry = old_entry_opt.is_some(); | 766 let had_entry = old_entry_opt.is_some(); |
767 let tracked_count_increment = if was_tracked { 0 } else { 1 }; | 767 let tracked_count_increment = u32::from(!was_tracked); |
768 let mut new = false; | 768 let mut new = false; |
769 | 769 |
770 let node = self.get_or_insert_node(filename, |ancestor| { | 770 let node = self.get_or_insert_node(filename, |ancestor| { |
771 if !had_entry { | 771 if !had_entry { |
772 ancestor.descendants_with_entry_count += 1; | 772 ancestor.descendants_with_entry_count += 1; |