Fixed bug: floats always end up in Decoder.toml, even when they have

been successfully decoded.
This commit is contained in:
Cameron Silvestrini 2015-12-15 22:43:24 +11:00
parent bfbeea6b44
commit caa4615536

View file

@ -57,7 +57,7 @@ impl rustc_serialize::Decoder for Decoder {
} }
fn read_f64(&mut self) -> Result<f64, DecodeError> { fn read_f64(&mut self) -> Result<f64, DecodeError> {
match self.toml { match self.toml {
Some(Value::Float(f)) => Ok(f), Some(Value::Float(f)) => { self.toml.take(); Ok(f) },
ref found => Err(self.mismatch("float", found)), ref found => Err(self.mismatch("float", found)),
} }
} }