mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 15:31:07 +00:00
partially implement deserializing options
This commit is contained in:
@@ -179,7 +179,10 @@ pub trait Deserializer<E>: Iterator<Result<Token, E>> {
|
|||||||
>(&mut self, token: Token) -> Result<Option<T>, E> {
|
>(&mut self, token: Token) -> Result<Option<T>, E> {
|
||||||
match token {
|
match token {
|
||||||
Null => Ok(None),
|
Null => Ok(None),
|
||||||
_ => fail!(),
|
token => {
|
||||||
|
let value: T = try!(Deserializable::deserialize_token(self, token));
|
||||||
|
Ok(Some(value))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user