rust/hg-core/src/dirstate_tree/status.rs
changeset 47119 15395fd8ab28
parent 47118 c92e63762573
child 47282 ce41ee53263f
equal deleted inserted replaced
47118:c92e63762573 47119:15395fd8ab28
   108             return;
   108             return;
   109         };
   109         };
   110 
   110 
   111         // `merge_join_by` requires both its input iterators to be sorted:
   111         // `merge_join_by` requires both its input iterators to be sorted:
   112 
   112 
   113         //
   113         let mut dirstate_nodes: Vec<_> = dirstate_nodes.iter_mut().collect();
   114         // * `BTreeMap` iterates according to keys’ ordering by definition
       
   115 
       
   116         // `sort_unstable_by_key` doesn’t allow keys borrowing from the value:
   114         // `sort_unstable_by_key` doesn’t allow keys borrowing from the value:
   117         // https://github.com/rust-lang/rust/issues/34162
   115         // https://github.com/rust-lang/rust/issues/34162
       
   116         dirstate_nodes
       
   117             .sort_unstable_by(|(path1, _), (path2, _)| path1.cmp(path2));
   118         fs_entries.sort_unstable_by(|e1, e2| e1.base_name.cmp(&e2.base_name));
   118         fs_entries.sort_unstable_by(|e1, e2| e1.base_name.cmp(&e2.base_name));
   119 
   119 
   120         itertools::merge_join_by(
   120         itertools::merge_join_by(
   121             dirstate_nodes,
   121             dirstate_nodes,
   122             &fs_entries,
   122             &fs_entries,