mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 15:31:07 +00:00
Update for rustc 1.0.0-nightly (8903c21d6 2015-01-15 22:42:58 +0000)
This commit is contained in:
@@ -72,13 +72,13 @@ mod decoder {
|
||||
|
||||
// Primitive types:
|
||||
fn read_nil(&mut self) -> Result<(), Error> { Err(SyntaxError) }
|
||||
fn read_uint(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_usize(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_u64(&mut self) -> Result<u64, Error> { Err(SyntaxError) }
|
||||
fn read_u32(&mut self) -> Result<u32, Error> { Err(SyntaxError) }
|
||||
fn read_u16(&mut self) -> Result<u16, Error> { Err(SyntaxError) }
|
||||
fn read_u8(&mut self) -> Result<u8, Error> { Err(SyntaxError) }
|
||||
#[inline]
|
||||
fn read_int(&mut self) -> Result<int, Error> {
|
||||
fn read_isize(&mut self) -> Result<int, Error> {
|
||||
match self.stack.pop() {
|
||||
Some(IntState(x)) => Ok(x),
|
||||
_ => Err(SyntaxError),
|
||||
|
||||
@@ -52,7 +52,7 @@ impl rustc_serialize::Encodable for HttpProtocol {
|
||||
|
||||
impl rustc_serialize::Decodable for HttpProtocol {
|
||||
fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<HttpProtocol, D::Error> {
|
||||
match FromPrimitive::from_uint(try!(d.read_uint())) {
|
||||
match FromPrimitive::from_uint(try!(d.read_usize())) {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(d.error("cannot convert from uint")),
|
||||
}
|
||||
@@ -96,7 +96,7 @@ impl rustc_serialize::Encodable for HttpMethod {
|
||||
|
||||
impl rustc_serialize::Decodable for HttpMethod {
|
||||
fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<HttpMethod, D::Error> {
|
||||
match FromPrimitive::from_uint(try!(d.read_uint())) {
|
||||
match FromPrimitive::from_uint(try!(d.read_usize())) {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(d.error("cannot convert from uint")),
|
||||
}
|
||||
@@ -133,7 +133,7 @@ impl rustc_serialize::Encodable for CacheStatus {
|
||||
|
||||
impl rustc_serialize::Decodable for CacheStatus {
|
||||
fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<CacheStatus, D::Error> {
|
||||
match FromPrimitive::from_uint(try!(d.read_uint())) {
|
||||
match FromPrimitive::from_uint(try!(d.read_usize())) {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(d.error("cannot convert from uint")),
|
||||
}
|
||||
@@ -179,7 +179,7 @@ impl rustc_serialize::Encodable for OriginProtocol {
|
||||
|
||||
impl rustc_serialize::Decodable for OriginProtocol {
|
||||
fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<OriginProtocol, D::Error> {
|
||||
match FromPrimitive::from_uint(try!(d.read_uint())) {
|
||||
match FromPrimitive::from_uint(try!(d.read_usize())) {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(d.error("cannot convert from uint")),
|
||||
}
|
||||
@@ -217,7 +217,7 @@ impl rustc_serialize::Encodable for ZonePlan {
|
||||
|
||||
impl rustc_serialize::Decodable for ZonePlan {
|
||||
fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<ZonePlan, D::Error> {
|
||||
match FromPrimitive::from_uint(try!(d.read_uint())) {
|
||||
match FromPrimitive::from_uint(try!(d.read_usize())) {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(d.error("cannot convert from uint")),
|
||||
}
|
||||
@@ -506,7 +506,7 @@ impl rustc_serialize::Encodable for Country {
|
||||
|
||||
impl rustc_serialize::Decodable for Country {
|
||||
fn decode<D: rustc_serialize::Decoder>(d: &mut D) -> Result<Country, D::Error> {
|
||||
match FromPrimitive::from_uint(try!(d.read_uint())) {
|
||||
match FromPrimitive::from_uint(try!(d.read_usize())) {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(d.error("cannot convert from uint")),
|
||||
}
|
||||
|
||||
@@ -66,13 +66,13 @@ mod decoder {
|
||||
|
||||
// Primitive types:
|
||||
fn read_nil(&mut self) -> Result<(), Error> { Err(SyntaxError) }
|
||||
fn read_uint(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_usize(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_u64(&mut self) -> Result<u64, Error> { Err(SyntaxError) }
|
||||
fn read_u32(&mut self) -> Result<u32, Error> { Err(SyntaxError) }
|
||||
fn read_u16(&mut self) -> Result<u16, Error> { Err(SyntaxError) }
|
||||
fn read_u8(&mut self) -> Result<u8, Error> { Err(SyntaxError) }
|
||||
#[inline]
|
||||
fn read_int(&mut self) -> Result<int, Error> {
|
||||
fn read_isize(&mut self) -> Result<int, Error> {
|
||||
match self.stack.pop() {
|
||||
Some(IntValue(x)) => Ok(x),
|
||||
Some(_) => Err(SyntaxError),
|
||||
|
||||
@@ -107,7 +107,7 @@ mod decoder {
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
fn read_uint(&mut self) -> Result<uint, Error> {
|
||||
fn read_usize(&mut self) -> Result<uint, Error> {
|
||||
match self.stack.pop() {
|
||||
Some(UintState(value)) => Ok(value),
|
||||
_ => Err(Error::SyntaxError("UintState".to_string())),
|
||||
@@ -117,7 +117,7 @@ mod decoder {
|
||||
fn read_u32(&mut self) -> Result<u32, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_u16(&mut self) -> Result<u16, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_u8(&mut self) -> Result<u8, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_int(&mut self) -> Result<int, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_isize(&mut self) -> Result<int, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_i64(&mut self) -> Result<i64, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_i32(&mut self) -> Result<i32, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
fn read_i16(&mut self) -> Result<i16, Error> { Err(Error::SyntaxError("".to_string())) }
|
||||
@@ -440,17 +440,17 @@ mod deserializer {
|
||||
|
||||
#[inline]
|
||||
fn syntax_error(&mut self, token: de::Token, expected: &[de::TokenKind]) -> Error {
|
||||
Error::SyntaxError(format!("expected {}, found {}", expected, token))
|
||||
Error::SyntaxError(format!("expected {:?}, found {:?}", expected, token))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn unexpected_name_error(&mut self, token: de::Token) -> Error {
|
||||
Error::UnexpectedName(format!("found {}", token))
|
||||
Error::UnexpectedName(format!("found {:?}", token))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn conversion_error(&mut self, token: de::Token) -> Error {
|
||||
Error::UnexpectedName(format!("found {}", token))
|
||||
Error::UnexpectedName(format!("found {:?}", token))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
@@ -56,13 +56,13 @@ mod decoder {
|
||||
|
||||
// Primitive types:
|
||||
fn read_nil(&mut self) -> Result<(), Error> { Err(SyntaxError) }
|
||||
fn read_uint(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_usize(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_u64(&mut self) -> Result<u64, Error> { Err(SyntaxError) }
|
||||
fn read_u32(&mut self) -> Result<u32, Error> { Err(SyntaxError) }
|
||||
fn read_u16(&mut self) -> Result<u16, Error> { Err(SyntaxError) }
|
||||
fn read_u8(&mut self) -> Result<u8, Error> { Err(SyntaxError) }
|
||||
#[inline]
|
||||
fn read_int(&mut self) -> Result<int, Error> {
|
||||
fn read_isize(&mut self) -> Result<int, Error> {
|
||||
match self.iter.next() {
|
||||
Some(value) => Ok(value),
|
||||
None => Err(EndOfStream),
|
||||
@@ -210,7 +210,7 @@ mod decoder {
|
||||
|
||||
// Primitive types:
|
||||
fn read_nil(&mut self) -> Result<(), Error> { Err(SyntaxError) }
|
||||
fn read_uint(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_usize(&mut self) -> Result<uint, Error> { Err(SyntaxError) }
|
||||
fn read_u64(&mut self) -> Result<u64, Error> { Err(SyntaxError) }
|
||||
fn read_u32(&mut self) -> Result<u32, Error> { Err(SyntaxError) }
|
||||
fn read_u16(&mut self) -> Result<u16, Error> { Err(SyntaxError) }
|
||||
@@ -222,7 +222,7 @@ mod decoder {
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
fn read_int(&mut self) -> Result<int, Error> { Err(SyntaxError) }
|
||||
fn read_isize(&mut self) -> Result<int, Error> { Err(SyntaxError) }
|
||||
fn read_i64(&mut self) -> Result<i64, Error> { Err(SyntaxError) }
|
||||
fn read_i32(&mut self) -> Result<i32, Error> { Err(SyntaxError) }
|
||||
fn read_i16(&mut self) -> Result<i16, Error> { Err(SyntaxError) }
|
||||
|
||||
Reference in New Issue
Block a user