about summary refs log tree commit diff
path: root/src/libserialize/json.rs
diff options
context:
space:
mode:
authorAlexis Beingessner <a.beingessner@gmail.com>2014-11-06 12:25:16 -0500
committerAlexis Beingessner <a.beingessner@gmail.com>2014-11-06 12:26:08 -0500
commiteec145be3f5e5f763e61749a6737f90df8504e05 (patch)
treeff30ca7802a92034a30cb57dcf4c89733b2952b6 /src/libserialize/json.rs
parentcf3b2e4fe6044cce018b723de9b21c500c6eac41 (diff)
downloadrust-eec145be3f5e5f763e61749a6737f90df8504e05.tar.gz
rust-eec145be3f5e5f763e61749a6737f90df8504e05.zip
Fallout from collection conventions
Diffstat (limited to 'src/libserialize/json.rs')
-rw-r--r--src/libserialize/json.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index dbdfa17bfc2..9f40cd2d277 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -2113,7 +2113,7 @@ impl ::Decoder<DecoderError> for Decoder {
         let name = match self.pop() {
             String(s) => s,
             Object(mut o) => {
-                let n = match o.pop(&"variant".to_string()) {
+                let n = match o.remove(&"variant".to_string()) {
                     Some(String(s)) => s,
                     Some(val) => {
                         return Err(ExpectedError("String".to_string(), format!("{}", val)))
@@ -2122,7 +2122,7 @@ impl ::Decoder<DecoderError> for Decoder {
                         return Err(MissingFieldError("variant".to_string()))
                     }
                 };
-                match o.pop(&"fields".to_string()) {
+                match o.remove(&"fields".to_string()) {
                     Some(List(l)) => {
                         for field in l.into_iter().rev() {
                             self.stack.push(field);
@@ -2192,7 +2192,7 @@ impl ::Decoder<DecoderError> for Decoder {
         debug!("read_struct_field(name={}, idx={})", name, idx);
         let mut obj = try!(expect!(self.pop(), Object));
 
-        let value = match obj.pop(&name.to_string()) {
+        let value = match obj.remove(&name.to_string()) {
             None => {
                 // Add a Null and try to parse it as an Option<_>
                 // to get None as a default value.
@@ -3072,8 +3072,8 @@ mod tests {
                   \"fields\":[\"Henry\", 349]}}";
         let mut map: TreeMap<string::String, Animal> = super::decode(s).unwrap();
 
-        assert_eq!(map.pop(&"a".to_string()), Some(Dog));
-        assert_eq!(map.pop(&"b".to_string()), Some(Frog("Henry".to_string(), 349)));
+        assert_eq!(map.remove(&"a".to_string()), Some(Dog));
+        assert_eq!(map.remove(&"b".to_string()), Some(Frog("Henry".to_string(), 349)));
     }
 
     #[test]