wip: remove error fns from de

This commit is contained in:
Erick Tryzelaar
2014-12-08 22:45:58 -08:00
parent b87f0f5fde
commit fcd276176b
4 changed files with 91 additions and 61 deletions
+12
View File
@@ -2,6 +2,8 @@ use std::error;
use std::fmt;
use std::io;
use de;
/// The errors that can arise while parsing a JSON stream.
#[deriving(Clone, PartialEq)]
pub enum ErrorCode {
@@ -124,3 +126,13 @@ impl error::FromError<io::IoError> for Error {
Error::IoError(error)
}
}
impl de::Error for Error {
fn syntax_error() -> Error {
Error::SyntaxError(ErrorCode::ExpectedSomeValue, 0, 0)
}
fn end_of_stream_error() -> Error {
Error::SyntaxError(ErrorCode::EOFWhileParsingValue, 0, 0)
}
}