mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-14 09:21:01 +00:00
use #[deriving_deserializable] everywhere
This commit is contained in:
@@ -7,11 +7,13 @@ use de::{Deserializer, Deserializable, Token};
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Show, Decodable)]
|
#[deriving(Clone, PartialEq, Show, Decodable)]
|
||||||
|
#[deriving_deserializable]
|
||||||
enum Animal {
|
enum Animal {
|
||||||
Dog,
|
Dog,
|
||||||
Frog(String, int)
|
Frog(String, int)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
impl Deserializable for Animal {
|
impl Deserializable for Animal {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn deserialize_token<
|
fn deserialize_token<
|
||||||
@@ -34,6 +36,7 @@ impl Deserializable for Animal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ use de::{Token, Deserializer, Deserializable};
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Show, Decodable)]
|
#[deriving(Clone, PartialEq, Show, Decodable)]
|
||||||
|
#[deriving_deserializable]
|
||||||
struct Inner {
|
struct Inner {
|
||||||
a: (),
|
a: (),
|
||||||
b: uint,
|
b: uint,
|
||||||
c: HashMap<String, Option<char>>,
|
c: HashMap<String, Option<char>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
impl Deserializable for Inner {
|
impl Deserializable for Inner {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn deserialize_token<
|
fn deserialize_token<
|
||||||
@@ -64,14 +66,17 @@ impl Deserializable for Inner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Show, Decodable)]
|
#[deriving(Clone, PartialEq, Show, Decodable)]
|
||||||
|
#[deriving_deserializable]
|
||||||
struct Outer {
|
struct Outer {
|
||||||
inner: Vec<Inner>,
|
inner: Vec<Inner>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
impl Deserializable for Outer {
|
impl Deserializable for Outer {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn deserialize_token<
|
fn deserialize_token<
|
||||||
@@ -113,6 +118,7 @@ impl Deserializable for Outer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user