Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 21, 2024
1 parent 35f8829 commit ac7ecc5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/aux_builds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {}
}

Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions src/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ impl CommentParser<Comments> {
}
"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();
Expand Down
2 changes: 1 addition & 1 deletion src/per_test_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ac7ecc5

Please sign in to comment.