core: Update all tests for fmt movement

This commit is contained in:
Alex Crichton 2014-05-11 11:14:14 -07:00
parent d12a136b22
commit 2e2160b026
27 changed files with 277 additions and 161 deletions

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// no-pretty-expanded
#![feature(phase)]
#[phase(syntax)] extern crate green;
@ -33,7 +35,7 @@ impl fmt::Show for Color {
Yellow => "yellow",
Blue => "blue",
};
f.buf.write(str.as_bytes())
write!(f, "{}", str)
}
}
@ -82,7 +84,7 @@ impl fmt::Show for Number {
}
for s in out.iter().rev() {
try!(f.buf.write(s.as_bytes()));
try!(write!(f, "{}", s))
}
Ok(())
}

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// no-pretty-expanded
#![allow(unused_must_use, dead_code)]
#![feature(macro_rules)]
@ -22,8 +24,9 @@ fn borrowing_writer_from_struct_and_formatting_struct_field(foo: Foo) {
write!(foo.writer, "{}", foo.other);
}
pub fn main() {
fn main() {
let mut w = MemWriter::new();
write!(&mut w as &mut Writer, "");
write!(&mut w, ""); // should coerce
println!("ok");
}