auto clippy fixes

This commit is contained in:
Folkert 2023-06-26 20:42:50 +02:00
parent 72c85efc83
commit ef39bad7c6
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
146 changed files with 750 additions and 1005 deletions

View file

@ -25,8 +25,7 @@ fn exec_bench_w_input<T: Measurement>(
assert!(
compile_out.status.success(),
"build ended with bad status {:?}",
compile_out
"build ended with bad status {compile_out:?}"
);
check_cmd_output(file, stdin_str, executable_filename, expected_ending);
@ -58,10 +57,7 @@ fn check_cmd_output(
};
if !&out.stdout.ends_with(expected_ending) {
panic!(
"expected output to end with {:?} but instead got {:#?}",
expected_ending, out
);
panic!("expected output to end with {expected_ending:?} but instead got {out:#?}");
}
assert!(out.status.success());
}
@ -96,7 +92,7 @@ fn bench_cmd<T: Measurement>(
}
if let Some(bench_group) = bench_group_opt {
bench_group.bench_function(&format!("Benchmarking {:?}", executable_filename), |b| {
bench_group.bench_function(&format!("Benchmarking {executable_filename:?}"), |b| {
b.iter(|| run_cmd(black_box(&cmd_str), black_box([stdin_str]), &[], []))
});
} else {

View file

@ -216,7 +216,7 @@ pub fn build_roc_bin(extra_args: &[&str]) -> PathBuf {
cargo_cmd.current_dir(root_project_dir).args(&args);
let cargo_cmd_str = format!("{:?}", cargo_cmd);
let cargo_cmd_str = format!("{cargo_cmd:?}");
let cargo_output = cargo_cmd.output().unwrap();
@ -255,7 +255,7 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.unwrap_or_else(|_| panic!("failed to execute cmd `{}` in CLI test", cmd_name));
.unwrap_or_else(|_| panic!("failed to execute cmd `{cmd_name}` in CLI test"));
{
let stdin = child.stdin.as_mut().expect("Failed to open stdin");
@ -269,7 +269,7 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a
let output = child
.wait_with_output()
.unwrap_or_else(|_| panic!("failed to execute cmd `{}` in CLI test", cmd_name));
.unwrap_or_else(|_| panic!("failed to execute cmd `{cmd_name}` in CLI test"));
Out {
cmd_str,