From ac7ecc57efd096df561acce9ed9f5773db9f21a9 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 21 May 2024 16:48:21 +0000 Subject: [PATCH] Clippy --- Cargo.toml | 2 +- src/aux_builds.rs | 2 +- src/config.rs | 2 +- src/dependencies.rs | 5 ++--- src/parser.rs | 2 +- src/per_test_config.rs | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f51c38b..45a133d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "MIT OR Apache-2.0" description = "A test framework for testing rustc diagnostics output" repository = "https://github.com/oli-obk/ui_test" -rust-version = "1.63" +rust-version = "1.70" [lib] test = true # we have unit tests diff --git a/src/aux_builds.rs b/src/aux_builds.rs index a67b3d07..1ea6fa63 100644 --- a/src/aux_builds.rs +++ b/src/aux_builds.rs @@ -104,7 +104,7 @@ impl Build for AuxBuilder { match CrateType::from_file_contents(&file_contents) { // Proc macros must be run on the host - CrateType::ProcMacro => config.target = config.host.clone(), + CrateType::ProcMacro => config.target.clone_from(&config.host), CrateType::Test | CrateType::Bin | CrateType::Lib => {} } diff --git a/src/config.rs b/src/config.rs index b2432ba1..2fb728e5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -127,7 +127,7 @@ impl Config { #[cfg(windows)] (Match::Exact(br"\\?\".to_vec()), b"".to_vec()), ]; - comment_defaults.base().normalize_stderr = filters.clone(); + comment_defaults.base().normalize_stderr.clone_from(&filters); comment_defaults.base().normalize_stdout = filters; comment_defaults.base().exit_status = Spanned::dummy(1).into(); comment_defaults.base().require_annotations = Spanned::dummy(true).into(); diff --git a/src/dependencies.rs b/src/dependencies.rs index a8a7f125..327bd40a 100644 --- a/src/dependencies.rs +++ b/src/dependencies.rs @@ -91,11 +91,10 @@ fn build_dependencies_inner( } // Reusable closure for setting up the environment both for artifact generation and `cargo_metadata` - let set_locking = |cmd: &mut Command| match config.output_conflict_handling { - OutputConflictHandling::Error => { + let set_locking = |cmd: &mut Command| { + if let OutputConflictHandling::Error = config.output_conflict_handling { cmd.arg("--locked"); } - _ => {} }; set_locking(&mut build); diff --git a/src/parser.rs b/src/parser.rs index 42004462..b070e21a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -744,7 +744,7 @@ impl CommentParser { } "check-pass" => (this, _args, span){ _ = this.exit_status.set(0, span.clone()); - _ = this.require_annotations = Spanned::new(false, span.clone()).into(); + this.require_annotations = Spanned::new(false, span.clone()).into(); } "require-annotations-for-level" => (this, args, span){ let args = args.trim(); diff --git a/src/per_test_config.rs b/src/per_test_config.rs index 97728eed..22673429 100644 --- a/src/per_test_config.rs +++ b/src/per_test_config.rs @@ -98,7 +98,7 @@ impl TestConfig<'_> { // Overwrite previous value so that revisions overwrite default settings // FIXME: report an error if multiple revisions conflict assert_eq!(o.get().len(), 1); - o.get_mut()[0] = &flag; + o.get_mut()[0] = flag; } else { o.get_mut().push(flag); }