Update to rust master
This commit is contained in:
parent
7b2aa23dbd
commit
71d1689d63
|
@ -39,7 +39,7 @@
|
||||||
#![crate_name = "toml"]
|
#![crate_name = "toml"]
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(macro_rules)]
|
#![feature(macro_rules)]
|
||||||
#![deny(missing_doc)]
|
#![deny(missing_docs)]
|
||||||
|
|
||||||
extern crate serialize;
|
extern crate serialize;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ mod serialization;
|
||||||
#[cfg(test)]mod test;
|
#[cfg(test)]mod test;
|
||||||
/// Representation of a TOML value.
|
/// Representation of a TOML value.
|
||||||
#[deriving(PartialEq, Clone)]
|
#[deriving(PartialEq, Clone)]
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_docs)]
|
||||||
pub enum Value {
|
pub enum Value {
|
||||||
String(string::String),
|
String(string::String),
|
||||||
Integer(i64),
|
Integer(i64),
|
||||||
|
|
|
@ -639,14 +639,14 @@ impl serialize::Decoder<DecodeError> for Decoder {
|
||||||
-> Result<T, DecodeError>
|
-> Result<T, DecodeError>
|
||||||
{
|
{
|
||||||
let toml = match self.toml {
|
let toml = match self.toml {
|
||||||
Some(Array(ref mut arr)) => mem::replace(arr.get_mut(idx), Integer(0)),
|
Some(Array(ref mut arr)) => mem::replace(&mut arr[idx], Integer(0)),
|
||||||
ref found => return Err(self.mismatch("array", found)),
|
ref found => return Err(self.mismatch("array", found)),
|
||||||
};
|
};
|
||||||
let mut d = self.sub_decoder(Some(toml), "");
|
let mut d = self.sub_decoder(Some(toml), "");
|
||||||
let ret = try!(f(&mut d));
|
let ret = try!(f(&mut d));
|
||||||
match d.toml {
|
match d.toml {
|
||||||
Some(toml) => match self.toml {
|
Some(toml) => match self.toml {
|
||||||
Some(Array(ref mut arr)) => *arr.get_mut(idx) = toml,
|
Some(Array(ref mut arr)) => arr[idx] = toml,
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
Loading…
Reference in a new issue