Merge pull request #1355 from matthiaskrgr/clippy_perf

clippy::perf fixes
This commit is contained in:
bjorn3 2023-02-10 21:06:22 +01:00 committed by GitHub
commit 291cadb2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -192,7 +192,7 @@ pub(crate) fn compile_fn(
let pass_times = cranelift_codegen::timing::take_current(); let pass_times = cranelift_codegen::timing::take_current();
// Replace newlines with | as measureme doesn't allow control characters like // Replace newlines with | as measureme doesn't allow control characters like
// newlines inside strings. // newlines inside strings.
recorder.record_arg(format!("{}", pass_times).replace("\n", " | ")); recorder.record_arg(format!("{}", pass_times).replace('\n', " | "));
recording_args = true; recording_args = true;
}, },
) )

View File

@ -125,7 +125,7 @@ pub(crate) fn compile_global_asm(
let output_object_file = config.output_filenames.temp_path(OutputType::Object, Some(cgu_name)); let output_object_file = config.output_filenames.temp_path(OutputType::Object, Some(cgu_name));
// Assemble `global_asm` // Assemble `global_asm`
let global_asm_object_file = add_file_stem_postfix(output_object_file.clone(), ".asm"); let global_asm_object_file = add_file_stem_postfix(output_object_file, ".asm");
let mut child = Command::new(&config.assembler) let mut child = Command::new(&config.assembler)
.arg("-o") .arg("-o")
.arg(&global_asm_object_file) .arg(&global_asm_object_file)

View File

@ -245,7 +245,7 @@ pub(crate) fn write_clif_file(
for flag in isa.flags().iter() { for flag in isa.flags().iter() {
writeln!(file, "set {}", flag)?; writeln!(file, "set {}", flag)?;
} }
write!(file, "target {}", isa.triple().architecture.to_string())?; write!(file, "target {}", isa.triple().architecture)?;
for isa_flag in isa.isa_flags().iter() { for isa_flag in isa.isa_flags().iter() {
write!(file, " {}", isa_flag)?; write!(file, " {}", isa_flag)?;
} }