From 39fc0df27d4b2306856bcbd7ff310fc61f99b2d8 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Fri, 27 Oct 2023 21:20:44 -0700 Subject: [PATCH] clippy: run `cargo clippy --fix --workspace` with recent nightly --- cli/src/commands/debug.rs | 2 +- cli/src/commands/mod.rs | 2 +- cli/tests/test_commit_command.rs | 2 +- cli/tests/test_describe_command.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/src/commands/debug.rs b/cli/src/commands/debug.rs index 14d2908e2b6..237dbe7b770 100644 --- a/cli/src/commands/debug.rs +++ b/cli/src/commands/debug.rs @@ -19,7 +19,7 @@ use std::io::Write as _; use clap::Subcommand; use jj_lib::backend::ObjectId; use jj_lib::default_index_store::{DefaultIndexStore, ReadonlyIndexWrapper}; -use jj_lib::local_working_copy::{LocalWorkingCopy, LockedLocalWorkingCopy}; +use jj_lib::local_working_copy::LocalWorkingCopy; use jj_lib::revset; use jj_lib::working_copy::WorkingCopy; diff --git a/cli/src/commands/mod.rs b/cli/src/commands/mod.rs index a2d90117470..69dd6c2ab23 100644 --- a/cli/src/commands/mod.rs +++ b/cli/src/commands/mod.rs @@ -3019,7 +3019,7 @@ fn cmd_resolve( ); }; - let (repo_path, _) = conflicts.get(0).unwrap(); + let (repo_path, _) = conflicts.first().unwrap(); workspace_command.check_rewritable([&commit])?; let mut tx = workspace_command.start_transaction(&format!( "Resolve conflicts in commit {}", diff --git a/cli/tests/test_commit_command.rs b/cli/tests/test_commit_command.rs index 1aa1f2070e8..2592aa32d22 100644 --- a/cli/tests/test_commit_command.rs +++ b/cli/tests/test_commit_command.rs @@ -85,7 +85,7 @@ fn test_commit_with_default_description() { std::fs::write(workspace_path.join("file1"), "foo\n").unwrap(); std::fs::write(workspace_path.join("file2"), "bar\n").unwrap(); let edit_script = test_env.set_up_fake_editor(); - std::fs::write(&edit_script, ["dump editor"].join("\0")).unwrap(); + std::fs::write(edit_script, ["dump editor"].join("\0")).unwrap(); test_env.jj_cmd_ok(&workspace_path, &["commit"]); insta::assert_snapshot!(get_log_output(&test_env, &workspace_path), @r#" diff --git a/cli/tests/test_describe_command.rs b/cli/tests/test_describe_command.rs index 6ecbfe27101..4effd8210bb 100644 --- a/cli/tests/test_describe_command.rs +++ b/cli/tests/test_describe_command.rs @@ -259,7 +259,7 @@ fn test_describe_default_description() { std::fs::write(workspace_path.join("file1"), "foo\n").unwrap(); std::fs::write(workspace_path.join("file2"), "bar\n").unwrap(); let edit_script = test_env.set_up_fake_editor(); - std::fs::write(&edit_script, ["dump editor"].join("\0")).unwrap(); + std::fs::write(edit_script, ["dump editor"].join("\0")).unwrap(); let (stdout, stderr) = test_env.jj_cmd_ok(&workspace_path, &["describe"]); insta::assert_snapshot!(stdout, @""); insta::assert_snapshot!(stderr, @r###"