diff --git a/benches/bench_log.rs b/benches/bench_log.rs index feafe19b..09c50efb 100644 --- a/benches/bench_log.rs +++ b/benches/bench_log.rs @@ -569,10 +569,10 @@ fn push_all_bytes(dst: &mut Vec, src: &[u8]) { let dst_len = dst.len(); let src_len = src.len(); - dst.reserve_additional(src_len); + dst.reserve(src_len); unsafe { - // we would have failed if `reserve_additional` overflowed. + // we would have failed if `reserve` overflowed. dst.set_len(dst_len + src_len); ::std::ptr::copy_nonoverlapping_memory( diff --git a/src/de.rs b/src/de.rs index f1c44d3d..2fa78ae6 100644 --- a/src/de.rs +++ b/src/de.rs @@ -882,27 +882,27 @@ impl GatherTokens { self.gather(d) } EnumStart(name, variant, len) => { - self.tokens.reserve_additional(len + 1); + self.tokens.reserve(len + 1); self.tokens.push(EnumStart(name, variant, len)); self.gather_seq(d) } StructStart(name, len) => { - self.tokens.reserve_additional(len + 1); + self.tokens.reserve(len + 1); self.tokens.push(StructStart(name, len)); self.gather_struct(d) } TupleStart(len) => { - self.tokens.reserve_additional(len + 1); + self.tokens.reserve(len + 1); self.tokens.push(TupleStart(len)); self.gather_seq(d) } SeqStart(len) => { - self.tokens.reserve_additional(len + 1); + self.tokens.reserve(len + 1); self.tokens.push(SeqStart(len)); self.gather_seq(d) } MapStart(len) => { - self.tokens.reserve_additional(len + 1); + self.tokens.reserve(len + 1); self.tokens.push(MapStart(len)); self.gather_map(d) } diff --git a/src/json/mod.rs b/src/json/mod.rs index 187d6af6..a89049a7 100644 --- a/src/json/mod.rs +++ b/src/json/mod.rs @@ -324,7 +324,7 @@ impl Json { /// Otherwise, returns None. pub fn find<'a>(&'a self, key: &string::String) -> Option<&'a Json>{ match self { - &Object(ref map) => map.find(key), + &Object(ref map) => map.get(key), _ => None } } @@ -349,7 +349,7 @@ impl Json { pub fn search<'a>(&'a self, key: &string::String) -> Option<&'a Json> { match self { &Object(ref map) => { - match map.find(key) { + match map.get(key) { Some(json_value) => Some(json_value), None => { let mut value : Option<&'a Json> = None;