Update to rust master

This commit is contained in:
Alex Crichton 2014-11-06 22:11:52 -08:00
parent d201170d47
commit ac6f3b27e0
2 changed files with 7 additions and 7 deletions

View file

@ -641,7 +641,7 @@ impl<'a> Parser<'a> {
let tmp = cur; let tmp = cur;
if tmp.contains_key(&part) { if tmp.contains_key(&part) {
match *tmp.find_mut(&part).unwrap() { match *tmp.get_mut(&part).unwrap() {
Table(ref mut table) => { Table(ref mut table) => {
cur = table; cur = table;
continue continue
@ -675,7 +675,7 @@ impl<'a> Parser<'a> {
// Initialize an empty table as part of this sub-key // Initialize an empty table as part of this sub-key
tmp.insert(part.clone(), Table(TreeMap::new())); 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, Table(ref mut inner) => cur = inner,
_ => unreachable!(), _ => unreachable!(),
} }
@ -702,10 +702,10 @@ impl<'a> Parser<'a> {
if !into.contains_key(&key) { if !into.contains_key(&key) {
into.insert(key.clone(), Table(TreeMap::new())); into.insert(key.clone(), Table(TreeMap::new()));
} }
match into.find_mut(&key) { match into.get_mut(&key) {
Some(&Table(ref mut table)) => { Some(&Table(ref mut table)) => {
for (k, v) in value.into_iter() { 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 { self.errors.push(ParserError {
lo: key_lo, lo: key_lo,
hi: key_lo + key.len(), hi: key_lo + key.len(),
@ -735,7 +735,7 @@ impl<'a> Parser<'a> {
if !into.contains_key(&key) { if !into.contains_key(&key) {
into.insert(key.clone(), Array(Vec::new())); into.insert(key.clone(), Array(Vec::new()));
} }
match *into.find_mut(&key).unwrap() { match *into.get_mut(&key).unwrap() {
Array(ref mut vec) => { Array(ref mut vec) => {
match vec.as_slice().head() { match vec.as_slice().head() {
Some(ref v) if !v.same_type(&value) => { Some(ref v) if !v.same_type(&value) => {

View file

@ -560,8 +560,8 @@ impl serialize::Decoder<DecodeError> for Decoder {
let field = f_name.to_string(); let field = f_name.to_string();
let toml = match self.toml { let toml = match self.toml {
Some(Table(ref mut table)) => { Some(Table(ref mut table)) => {
table.pop(&field) table.remove(&field)
.or_else(|| table.pop(&f_name.replace("_", "-"))) .or_else(|| table.remove(&f_name.replace("_", "-")))
}, },
ref found => return Err(self.mismatch("table", found)), ref found => return Err(self.mismatch("table", found)),
}; };