Update to rust HEAD

This commit is contained in:
Erick Tryzelaar
2015-02-10 07:50:43 -08:00
parent 4ca70c1396
commit 044825829a
3 changed files with 24 additions and 2 deletions
+10 -1
View File
@@ -39,6 +39,8 @@ pub enum ErrorCode {
impl fmt::Debug for ErrorCode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use std::fmt::Debug;
match *self {
//ErrorCode::ConversionError(ref token) => write!(f, "failed to convert {}", token),
ErrorCode::EOFWhileParsingList => "EOF While parsing list".fmt(f),
@@ -91,7 +93,7 @@ impl error::Error for Error {
fn description(&self) -> &str {
match *self {
Error::SyntaxError(..) => "syntax error",
Error::IoError(_) => "input/output error",
Error::IoError(ref error) => error.description().as_slice(),
/*
Error::ExpectedError(ref expected, _) => &expected,
Error::MissingFieldError(_) => "missing field",
@@ -100,6 +102,13 @@ impl error::Error for Error {
}
}
fn cause(&self) -> Option<&error::Error> {
match *self {
Error::IoError(ref error) => Some(error),
_ => None,
}
}
}
impl fmt::Display for Error {
+1 -1
View File
@@ -67,7 +67,7 @@ impl fmt::Debug for Value {
pub fn to_value<T>(value: &T) -> Value where T: ser::Serialize {
let mut writer = Writer::new();
writer.visit(value).unwrap();
writer.visit(value).ok().unwrap();
writer.unwrap()
}