initial support for #[deriving_deserializable]

This commit is contained in:
Erick Tryzelaar
2014-06-28 08:39:02 -07:00
parent eaa1fc26d1
commit bf58947037
2 changed files with 380 additions and 35 deletions
+14
View File
@@ -153,6 +153,13 @@ pub trait Deserializer<E>: Iterator<Result<Token, E>> {
}
}
#[inline]
fn expect_tuple_sep<
T: Deserializable
>(&mut self) -> Result<T, E> {
Deserializable::deserialize(self)
}
#[inline]
fn expect_tuple_end(&mut self) -> Result<(), E> {
match try!(self.expect_token()) {
@@ -221,6 +228,13 @@ pub trait Deserializer<E>: Iterator<Result<Token, E>> {
}
}
#[inline]
fn expect_enum_sep<
T: Deserializable
>(&mut self) -> Result<T, E> {
Deserializable::deserialize(self)
}
#[inline]
fn expect_enum_end(&mut self) -> Result<(), E> {
match try!(self.expect_token()) {