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;
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) => {

View file

@ -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)),
};