diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-11-06 22:11:52 -0800 | 
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-11-06 22:11:52 -0800 | 
| commit | ac6f3b27e03e7a5938fd4cae5fc3fecc5ab1a85f (patch) | |
| tree | d7460b77e6e207e95d1df2699dc36fd99cbf8fbf /src | |
| parent | d201170d4791cca7f3d2a8dce0fc94d145922c40 (diff) | |
| download | milf-rs-ac6f3b27e03e7a5938fd4cae5fc3fecc5ab1a85f.tar.gz milf-rs-ac6f3b27e03e7a5938fd4cae5fc3fecc5ab1a85f.zip | |
Update to rust master
Diffstat (limited to 'src')
| -rw-r--r-- | src/parser.rs | 10 | ||||
| -rw-r--r-- | 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<DecodeError> 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)),          }; |