From ac6f3b27e03e7a5938fd4cae5fc3fecc5ab1a85f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 6 Nov 2014 22:11:52 -0800 Subject: Update to rust master --- src/parser.rs | 10 +++++----- src/serialization.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index e1d784d..921b917 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -641,7 +641,7 @@ impl<'a> Parser<'a> { let tmp = cur; if tmp.contains_key(&part) { - match *tmp.find_mut(&part).unwrap() { + match *tmp.get_mut(&part).unwrap() { Table(ref mut table) => { cur = table; continue @@ -675,7 +675,7 @@ impl<'a> Parser<'a> { // Initialize an empty table as part of this sub-key tmp.insert(part.clone(), Table(TreeMap::new())); - match *tmp.find_mut(&part).unwrap() { + match *tmp.get_mut(&part).unwrap() { Table(ref mut inner) => cur = inner, _ => unreachable!(), } @@ -702,10 +702,10 @@ impl<'a> Parser<'a> { if !into.contains_key(&key) { into.insert(key.clone(), Table(TreeMap::new())); } - match into.find_mut(&key) { + match into.get_mut(&key) { Some(&Table(ref mut table)) => { for (k, v) in value.into_iter() { - if !table.insert(k.clone(), v) { + if table.insert(k.clone(), v).is_some() { self.errors.push(ParserError { lo: key_lo, hi: key_lo + key.len(), @@ -735,7 +735,7 @@ impl<'a> Parser<'a> { if !into.contains_key(&key) { into.insert(key.clone(), Array(Vec::new())); } - match *into.find_mut(&key).unwrap() { + match *into.get_mut(&key).unwrap() { Array(ref mut vec) => { match vec.as_slice().head() { Some(ref v) if !v.same_type(&value) => { diff --git a/src/serialization.rs b/src/serialization.rs index 3c5eb87..fda7c06 100644 --- a/src/serialization.rs +++ b/src/serialization.rs @@ -560,8 +560,8 @@ impl serialize::Decoder for Decoder { let field = f_name.to_string(); let toml = match self.toml { Some(Table(ref mut table)) => { - table.pop(&field) - .or_else(|| table.pop(&f_name.replace("_", "-"))) + table.remove(&field) + .or_else(|| table.remove(&f_name.replace("_", "-"))) }, ref found => return Err(self.mismatch("table", found)), }; -- cgit v1.2.3