diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index b9b6e1278b..a79121d8fb 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -1871,7 +1871,7 @@ See https://martinvonz.github.io/jj/latest/working-copy/#stale-working-copy \ let conflicts = new_commit.tree()?.conflicts().collect_vec(); if !conflicts.is_empty() { writeln!(formatter, "There are unresolved conflicts at these paths:")?; - print_conflicted_paths(&conflicts, formatter.as_mut(), self)?; + print_conflicted_paths(conflicts, formatter.as_mut(), self)?; } } } @@ -2428,7 +2428,7 @@ fn update_stale_working_copy( #[instrument(skip_all)] pub fn print_conflicted_paths( - conflicts: &[(RepoPathBuf, MergedTreeValue)], + conflicts: Vec<(RepoPathBuf, MergedTreeValue)>, formatter: &mut dyn Formatter, workspace_command: &WorkspaceCommandHelper, ) -> Result<(), CommandError> { @@ -2441,8 +2441,8 @@ pub fn print_conflicted_paths( .into_iter() .map(|p| format!("{:width$}", p, width = max_path_len.min(32) + 3)); - for ((_, conflict), formatted_path) in std::iter::zip(conflicts.iter(), formatted_paths) { - let conflict = conflict.clone().simplify(); + for ((_, conflict), formatted_path) in std::iter::zip(conflicts.into_iter(), formatted_paths) { + let conflict = conflict.simplify(); let sides = conflict.num_sides(); let n_adds = conflict.adds().flatten().count(); let deletions = sides - n_adds; diff --git a/cli/src/commands/resolve.rs b/cli/src/commands/resolve.rs index a03a2f8b8d..0f5d5a4160 100644 --- a/cli/src/commands/resolve.rs +++ b/cli/src/commands/resolve.rs @@ -91,7 +91,7 @@ pub(crate) fn cmd_resolve( } if args.list { return print_conflicted_paths( - &conflicts, + conflicts, ui.stdout_formatter().as_mut(), &workspace_command, ); @@ -129,7 +129,7 @@ pub(crate) fn cmd_resolve( formatter, "After this operation, some files at this revision still have conflicts:" )?; - print_conflicted_paths(&new_conflicts, formatter.as_mut(), &workspace_command)?; + print_conflicted_paths(new_conflicts, formatter.as_mut(), &workspace_command)?; } } } diff --git a/cli/src/commands/status.rs b/cli/src/commands/status.rs index 794cf4f928..e9f52d525a 100644 --- a/cli/src/commands/status.rs +++ b/cli/src/commands/status.rs @@ -93,7 +93,7 @@ pub(crate) fn cmd_status( formatter.labeled("conflict"), "There are unresolved conflicts at these paths:" )?; - print_conflicted_paths(&conflicts, formatter, &workspace_command)?; + print_conflicted_paths(conflicts, formatter, &workspace_command)?; } let template = workspace_command.commit_summary_template();