changeset 46650:1fce35fcb4db

copies-rust: pass `PathToken` around by value It’s just a `usize`. Differential Revision: https://phab.mercurial-scm.org/D10069
author Simon Sapin <simon.sapin@octobus.net>
date Fri, 08 Jan 2021 11:58:16 +0100
parents d7d64b8c8229
children 80f7567ac9bb
files rust/hg-core/src/copy_tracing.rs
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/copy_tracing.rs	Wed Feb 24 09:27:33 2021 -0800
+++ b/rust/hg-core/src/copy_tracing.rs	Fri Jan 08 11:58:16 2021 +0100
@@ -617,7 +617,7 @@
 ) -> InternalPathCopies {
     use crate::utils::{ordmap_union_with_merge, MergeResult};
 
-    ordmap_union_with_merge(minor, major, |dest, src_minor, src_major| {
+    ordmap_union_with_merge(minor, major, |&dest, src_minor, src_major| {
         let (pick, overwrite) = compare_value(
             path_map,
             current_merge,
@@ -664,7 +664,7 @@
     path_map: &TwoWayPathMap,
     current_merge: Revision,
     changes: &ChangedFiles,
-    dest: &PathToken,
+    dest: PathToken,
     src_minor: &CopySource,
     src_major: &CopySource,
 ) -> (MergePick, bool) {
@@ -693,7 +693,7 @@
         }
     } else {
         debug_assert!(src_major.rev != src_major.rev);
-        let dest_path = path_map.untokenize(*dest);
+        let dest_path = path_map.untokenize(dest);
         let action = changes.get_merge_case(dest_path);
         if src_minor.path.is_some()
             && src_major.path.is_none()