Update for rustc 1.0.0-nightly (8903c21d6 2015-01-15 22:42:58 +0000)

This commit is contained in:
Dan Burkert
2015-01-17 16:32:29 -08:00
parent 8715a41158
commit 460dbce8cc
19 changed files with 160 additions and 147 deletions
+12 -3
View File
@@ -3,6 +3,7 @@ use std::fmt;
use std::io::{ByRefWriter, IoResult};
use std::io;
use std::str;
use std::string::ToString;
use std::vec;
use de::{self, Token, TokenKind};
@@ -207,6 +208,14 @@ impl Value {
}
}
impl ToString for Value {
fn to_string(&self) -> String {
let mut wr = Vec::new();
self.to_writer(wr.by_ref()).unwrap();
str::from_utf8(wr.as_slice()).unwrap().to_string()
}
}
struct WriterFormatter<'a, 'b: 'a> {
inner: &'a mut fmt::Formatter<'b>,
}
@@ -449,7 +458,7 @@ impl de::Deserializer<Error> for Deserializer {
return Err(
Error::ExpectedError(
"Array".to_string(),
format!("{} => {}", key, value)
format!("{:?} => {:?}", key, value)
)
);
}
@@ -464,7 +473,7 @@ impl de::Deserializer<Error> for Deserializer {
return Err(
Error::ExpectedError(
"None".to_string(),
format!("{} => {}", key, value)
format!("{:?} => {:?}", key, value)
)
);
}
@@ -483,7 +492,7 @@ impl de::Deserializer<Error> for Deserializer {
return Err(
Error::ExpectedError(
"String or Object".to_string(),
format!("{}", token)
format!("{:?}", token)
)
);
}