@@ -23,7 +23,7 @@ use std::collections::HashMap;
2323/// over a directory rewrite in *our* tree. If so, rewrite it so that we get the path
2424/// it would have had if it had been renamed along with *our* directory.
2525pub fn possibly_rewritten_location (
26- check_tree : & mut TreeNodes ,
26+ check_tree : & TreeNodes ,
2727 their_location : & BStr ,
2828 our_changes : & ChangeListRef ,
2929) -> Option < BString > {
@@ -60,7 +60,7 @@ pub fn rewrite_location_with_renamed_directory(their_location: &BStr, passed_cha
6060pub fn unique_path_in_tree (
6161 file_path : & BStr ,
6262 editor : & tree:: Editor < ' _ > ,
63- tree : & mut TreeNodes ,
63+ tree : & TreeNodes ,
6464 side_name : & BStr ,
6565) -> Result < BString , Error > {
6666 let mut buf = file_path. to_owned ( ) ;
@@ -414,12 +414,12 @@ impl TreeNodes {
414414
415415 /// Search the tree with `our` changes for `theirs` by [`source_location()`](Change::source_location())).
416416 /// If there is an entry but both are the same, or if there is no entry, return `None`.
417- pub fn check_conflict ( & mut self , theirs_location : & BStr ) -> Option < PossibleConflict > {
417+ pub fn check_conflict ( & self , theirs_location : & BStr ) -> Option < PossibleConflict > {
418418 if self . 0 . len ( ) == 1 {
419419 return None ;
420420 }
421421 let components = to_components ( theirs_location) ;
422- let mut cursor = & mut self . 0 [ 0 ] ;
422+ let mut cursor = & self . 0 [ 0 ] ;
423423 let mut cursor_idx = 0 ;
424424 let mut intermediate_change = None ;
425425 for component in components {
@@ -436,7 +436,7 @@ impl TreeNodes {
436436 } else {
437437 // a change somewhere else, i.e. `a/c` and we know `a/b` only.
438438 intermediate_change. and_then ( |( change, cursor_idx) | {
439- let cursor = & mut self . 0 [ cursor_idx] ;
439+ let cursor = & self . 0 [ cursor_idx] ;
440440 // If this is a destination location of a rename, then the `their_location`
441441 // is already at the right spot, and we can just ignore it.
442442 if matches ! ( cursor. location, ChangeLocation :: CurrentLocation ) {
@@ -450,7 +450,7 @@ impl TreeNodes {
450450 }
451451 Some ( child_idx) => {
452452 cursor_idx = child_idx;
453- cursor = & mut self . 0 [ cursor_idx] ;
453+ cursor = & self . 0 [ cursor_idx] ;
454454 }
455455 }
456456 }
@@ -504,7 +504,7 @@ impl TreeNodes {
504504 cursor = & mut self . 0 [ existing_idx] ;
505505 debug_assert ! (
506506 cursor. is_leaf_node( ) ,
507- "BUG: we should really only try to remove leaf nodes"
507+ "BUG: we should really only try to remove leaf nodes: {cursor:?} "
508508 ) ;
509509 cursor. change_idx = None ;
510510 } else {
0 commit comments