pub fn search<'a>(&'a self, key: &str) -> Option<&'a Xml> {
        match self {
            &Xml::Object(ref map) => {
                match map.get(key) {
                    Some(xml_value) => Some(xml_value),
                    None => {
                        for (_, v) in map.iter() {
                            match v.search(key) {
                                x if x.is_some() => return x,
                                _ => (),
                            }
                        }
                        None
                    }
                }
            }
            _ => None,
        }
    }
/// If the XML 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 XML value is not an Object, returns None.
If the XML 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 XML value is not an Object, returns None.
If the XML 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 XML value is not an Object returns None .
pub fn search<'a>(&'a self, key: &str) -> Option<&'a Xml> {
        match self {
            &Xml::Object(ref map) => {
                match map.get(key) {
                    Some(xml_value) => Some(xml_value),
                    None => {
                        for (_, v) in map.iter() {
                            match v.search(key) {
                                x if x.is_some() => return x,
                                _ => (),
                            }
                        }
                        None
                    }
                }
            }
            _ => None,
        }
    }
pub fn search < ' a > ( & ' a self , key : & str ) -> Option < & ' a Xml > { match self { & Xml :: Object ( ref map ) => { match map . get ( key ) { Some ( xml_value ) => Some ( xml_value ) , None => { for ( _ , v ) in map . iter ( ) { match v . search ( key ) { x if x . is_some ( ) => return x , _ => ( ) , } } None } } } _ => None , } }
If the XML value is an Object, performs a depth-first search until
a value associated with the provided key is found.
If the XML value is an Object performs a depth - first search until a value associated with the provided key is found .
&'a self
key
&str