1
Fork 0

Fallout from deprecation

This commit handles the fallout from deprecating `_with` and `_equiv` methods.
This commit is contained in:
Aaron Turon 2014-11-12 15:51:51 -08:00
parent 80a2867ea7
commit 7213de1c49
21 changed files with 56 additions and 49 deletions

View file

@ -901,7 +901,7 @@ impl Json {
/// Otherwise, returns None.
pub fn find<'a>(&'a self, key: &str) -> Option<&'a Json>{
match self {
&Object(ref map) => map.find_with(|s| key.cmp(s.as_slice())),
&Object(ref map) => map.get(key),
_ => None
}
}
@ -926,7 +926,7 @@ impl Json {
pub fn search<'a>(&'a self, key: &str) -> Option<&'a Json> {
match self {
&Object(ref map) => {
match map.find_with(|s| key.cmp(s.as_slice())) {
match map.get(key) {
Some(json_value) => Some(json_value),
None => {
for (_, v) in map.iter() {