mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
change json::Deserializer to take a json enum
This allows the deserializer to be used on an already parsed json object.
This commit is contained in:
parent
2d4c217186
commit
77ef4e7176
@ -702,14 +702,8 @@ pub struct Deserializer {
|
||||
priv mut stack: ~[&Json],
|
||||
}
|
||||
|
||||
pub fn Deserializer(rdr: io::Reader) -> Result<Deserializer, Error> {
|
||||
match move from_reader(rdr) {
|
||||
Ok(move json) => {
|
||||
let des = Deserializer { json: move json, stack: ~[] };
|
||||
Ok(move des)
|
||||
}
|
||||
Err(move e) => Err(e)
|
||||
}
|
||||
pub fn Deserializer(json: Json) -> Deserializer {
|
||||
Deserializer { json: move json, stack: ~[] }
|
||||
}
|
||||
|
||||
priv impl Deserializer {
|
||||
|
Loading…
Reference in New Issue
Block a user