##// END OF EJS Templates
rust: don't use a reference to a `Cow`...
Raphaël Gomès -
r50817:b6dc4802 default
parent child Browse files
Show More
@@ -912,7 +912,7 b" impl<'on_disk> DirstateMap<'on_disk> {"
912 912 })
913 913 }
914 914
915 fn count_dropped_path(unreachable_bytes: &mut u32, path: &Cow<HgPath>) {
915 fn count_dropped_path(unreachable_bytes: &mut u32, path: Cow<HgPath>) {
916 916 if let Cow::Borrowed(path) = path {
917 917 *unreachable_bytes += path.len() as u32
918 918 }
@@ -1124,7 +1124,10 b' impl OwningDirstateMap {'
1124 1124 }
1125 1125 let mut had_copy_source = false;
1126 1126 if let Some(source) = &node.copy_source {
1127 DirstateMap::count_dropped_path(unreachable_bytes, source);
1127 DirstateMap::count_dropped_path(
1128 unreachable_bytes,
1129 Cow::Borrowed(source),
1130 );
1128 1131 had_copy_source = true;
1129 1132 node.copy_source = None
1130 1133 }
@@ -1144,7 +1147,7 b' impl OwningDirstateMap {'
1144 1147 nodes.remove_entry(first_path_component).unwrap();
1145 1148 DirstateMap::count_dropped_path(
1146 1149 unreachable_bytes,
1147 key.full_path(),
1150 Cow::Borrowed(key.full_path()),
1148 1151 )
1149 1152 }
1150 1153 Ok(Some((dropped, remove)))
@@ -1343,7 +1346,10 b' impl OwningDirstateMap {'
1343 1346 *count = count
1344 1347 .checked_sub(1)
1345 1348 .expect("nodes_with_copy_source_count should be >= 0");
1346 DirstateMap::count_dropped_path(unreachable_bytes, source);
1349 DirstateMap::count_dropped_path(
1350 unreachable_bytes,
1351 Cow::Borrowed(source),
1352 );
1347 1353 }
1348 1354 node.copy_source.take().map(Cow::into_owned)
1349 1355 }))
General Comments 0
You need to be logged in to leave comments. Login now