mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-24 07:38:01 +00:00
Update to rust HEAD
This commit is contained in:
+6
-1
@@ -12,6 +12,7 @@ use de::{Deserializer, Deserializable};
|
||||
enum Error {
|
||||
EndOfStream,
|
||||
SyntaxError,
|
||||
OtherError(String),
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,7 +22,7 @@ mod decoder {
|
||||
use std::collections::hashmap::MoveEntries;
|
||||
use serialize;
|
||||
|
||||
use super::{Error, EndOfStream, SyntaxError};
|
||||
use super::{Error, EndOfStream, SyntaxError, OtherError};
|
||||
|
||||
enum Value {
|
||||
StringValue(String),
|
||||
@@ -46,6 +47,10 @@ mod decoder {
|
||||
}
|
||||
|
||||
impl serialize::Decoder<Error> for IntDecoder {
|
||||
fn error(&mut self, msg: &str) -> Error {
|
||||
OtherError(msg.to_string())
|
||||
}
|
||||
|
||||
// Primitive types:
|
||||
fn read_nil(&mut self) -> Result<(), Error> { Err(SyntaxError) }
|
||||
fn read_uint(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
|
||||
Reference in New Issue
Block a user