rollup merge of #20353: alexcrichton/snapshots

This commit is contained in:
Alex Crichton 2014-12-30 16:26:24 -08:00
commit dd0f29ad0f
20 changed files with 11 additions and 756 deletions

View file

@ -994,20 +994,11 @@ pub trait ToString {
}
impl<T: fmt::Show> ToString for T {
// NOTE(stage0): Remove cfg after a snapshot
#[cfg(not(stage0))]
fn to_string(&self) -> String {
let mut buf = Vec::<u8>::new();
let _ = fmt::write(&mut buf, format_args!("{}", *self));
String::from_utf8(buf).unwrap()
}
// NOTE(stage0): Remove method after a snapshot
#[cfg(stage0)]
fn to_string(&self) -> String {
let mut buf = Vec::<u8>::new();
let _ = format_args!(|args| fmt::write(&mut buf, args), "{}", self);
String::from_utf8(buf).unwrap()
}
}
impl IntoCow<'static, String, str> for String {