Use to_string() instead of write!(&mut text, "{}", ....
This commit is contained in:
@@ -10,7 +10,6 @@ use cretonne_codegen::ir::Function;
|
||||
use cretonne_codegen::print_errors::pretty_error;
|
||||
use cretonne_reader::TestCommand;
|
||||
use std::borrow::Cow;
|
||||
use std::fmt::Write;
|
||||
use subtest::{run_filecheck, Context, Result, SubTest};
|
||||
|
||||
struct TestRegalloc;
|
||||
@@ -51,8 +50,7 @@ impl SubTest for TestRegalloc {
|
||||
.regalloc(isa)
|
||||
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, e))?;
|
||||
|
||||
let mut text = String::new();
|
||||
write!(&mut text, "{}", &comp_ctx.func.display(Some(isa))).map_err(|e| e.to_string())?;
|
||||
let text = comp_ctx.func.display(Some(isa)).to_string();
|
||||
run_filecheck(&text, context)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user