Use x.to_string() instead of format!("{}", x).

Both use the Display trait.
This commit is contained in:
Jakob Stoklund Olesen
2016-04-29 11:55:40 -07:00
parent 88931983a8
commit 5c4f3d01e2
5 changed files with 96 additions and 99 deletions

View File

@@ -449,7 +449,7 @@ mod tests {
ty: types::I32,
};
let inst = func.make_inst(idata);
assert_eq!(format!("{}", inst), "inst0");
assert_eq!(inst.to_string(), "inst0");
// Immutable reference resolution.
let ins = func.inst(inst);
@@ -463,8 +463,8 @@ mod tests {
let ss0 = func.make_stack_slot(StackSlotData::new(4));
let ss1 = func.make_stack_slot(StackSlotData::new(8));
assert_eq!(format!("{}", ss0), "ss0");
assert_eq!(format!("{}", ss1), "ss1");
assert_eq!(ss0.to_string(), "ss0");
assert_eq!(ss1.to_string(), "ss1");
assert_eq!(func[ss0].size, 4);
assert_eq!(func[ss1].size, 8);