From e5e95225d4bab93ec5e3519002365204a387d937 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 7 Sep 2024 08:55:53 -0700 Subject: [PATCH] cleanup: inline some short single-use `mut_repo` variables --- cli/src/commands/diffedit.rs | 4 ++-- cli/src/commands/restore.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/src/commands/diffedit.rs b/cli/src/commands/diffedit.rs index 44f8c90ed..860cdbfcf 100644 --- a/cli/src/commands/diffedit.rs +++ b/cli/src/commands/diffedit.rs @@ -108,8 +108,8 @@ don't make any changes, then the operation will be aborted.", if tree_id == *target_commit.tree_id() { writeln!(ui.status(), "Nothing changed.")?; } else { - let mut_repo = tx.mut_repo(); - let new_commit = mut_repo + let new_commit = tx + .mut_repo() .rewrite_commit(command.settings(), &target_commit) .set_tree_id(tree_id) .write()?; diff --git a/cli/src/commands/restore.rs b/cli/src/commands/restore.rs index af6d111a5..771c766eb 100644 --- a/cli/src/commands/restore.rs +++ b/cli/src/commands/restore.rs @@ -109,8 +109,8 @@ pub(crate) fn cmd_restore( writeln!(ui.status(), "Nothing changed.")?; } else { let mut tx = workspace_command.start_transaction(); - let mut_repo = tx.mut_repo(); - let new_commit = mut_repo + let new_commit = tx + .mut_repo() .rewrite_commit(command.settings(), &to_commit) .set_tree_id(new_tree_id) .write()?;