File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -855,9 +855,7 @@ impl serialize::Decoder for Decoder {
855
855
}
856
856
_ => fail!(~" not a list"),
857
857
};
858
- let res = f(len);
859
- self.stack.pop();
860
- res
858
+ f(len)
861
859
}
862
860
863
861
fn read_seq_elt<T>(&self, idx: uint, f: &fn() -> T) -> T {
@@ -1675,10 +1673,10 @@ mod tests {
1675
1673
fn test_read_map() {
1676
1674
let s = ~" { \" a\" : \"Dog \" , \"b\" : [ \" Frog \" , \"Henry \" , 349 ] } ";
1677
1675
let decoder = Decoder(from_str(s).unwrap());
1678
- let map: LinearMap<~str, Animal> = Decodable::decode(&decoder);
1676
+ let mut map: LinearMap<~str, Animal> = Decodable::decode(&decoder);
1679
1677
1680
- assert_eq!(map.find (&~" a"), Some(Dog));
1681
- assert_eq!(map.find (&~" b"), Some(Frog(~" Henry ", 349)));
1678
+ assert_eq!(map.pop (&~" a"), Some(Dog));
1679
+ assert_eq!(map.pop (&~" b"), Some(Frog(~" Henry ", 349)));
1682
1680
}
1683
1681
1684
1682
#[test]
You can’t perform that action at this time.
0 commit comments