diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-11-12 12:17:55 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-11-12 12:17:55 -0800 |
| commit | 065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3 (patch) | |
| tree | 7dc0761aee6f0eef769a3a4bbc475d3df7a789f4 /src/libserialize | |
| parent | e4ead7b034c96b705ec34b8325f5f9f778f1cbb9 (diff) | |
| download | rust-065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3.tar.gz rust-065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3.zip | |
Register new snapshots
Diffstat (limited to 'src/libserialize')
| -rw-r--r-- | src/libserialize/json.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 77313517585..0b557b9142f 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -890,18 +890,6 @@ impl Json { /// If the Json value is an Object, returns the value associated with the provided key. /// Otherwise, returns None. - // NOTE(stage0): remove function after a snapshot - #[cfg(stage0)] - 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())), - _ => None - } - } - - /// If the Json value is an Object, returns the value associated with the provided key. - /// Otherwise, returns None. - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot 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())), @@ -926,32 +914,6 @@ impl Json { /// If the Json value is an Object, performs a depth-first search until /// a value associated with the provided key is found. If no value is found /// or the Json value is not an Object, returns None. - // NOTE(stage0): remove function after a snapshot - #[cfg(stage0)] - 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())) { - Some(json_value) => Some(json_value), - None => { - for (_, v) in map.iter() { - match v.search(key) { - x if x.is_some() => return x, - _ => () - } - } - None - } - } - }, - _ => None - } - } - - /// If the Json value is an Object, performs a depth-first search until - /// a value associated with the provided key is found. If no value is found - /// or the Json value is not an Object, returns None. - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot pub fn search<'a>(&'a self, key: &str) -> Option<&'a Json> { match self { &Object(ref map) => { |
