fn section_tree(&self, section: &str) -> BTreeSet<String>
    where
        T: Clone,
    {
        // TODO: `keys` could be simplified if nightly feature map_first_last is
        // stabilized, see <https://github.com/rust-lang/rust/issues/62924>
        let mut keys = vec![];
        let mut result = BTreeSet::new();
        keys.extend(
            self.clone()
                .walk_tree(section)
                // ignore current section's name
                .map(|(k, _)| {
                    if section.is_empty() {
                        k.as_ref().to_string()
                    } else {
                        k.as_ref()[section.len() + 1..].to_string()
                    }
                }),
        );

        while let Some(key) = keys.pop() {
            if let Some(pos) = key.rfind('.') {
                let section = key.split_at(pos).0.to_string();
                if !keys.contains(&section) && !result.contains(&section) {
                    keys.push(section.clone());
                }
                result.insert(section.to_string());
            }
        }

        result
    }
/// Implements the `SectionTree` API function.
Implements the `SectionTree` API function.
Implements the ` SectionTree ` API function .
fn section_tree(&self, section: &str) -> BTreeSet<String>
    where
        T: Clone,
    {
        // TODO: `keys` could be simplified if nightly feature map_first_last is
        // stabilized, see <https://github.com/rust-lang/rust/issues/62924>
        let mut keys = vec![];
        let mut result = BTreeSet::new();
        keys.extend(
            self.clone()
                .walk_tree(section)
                // ignore current section's name
                .map(|(k, _)| {
                    if section.is_empty() {
                        k.as_ref().to_string()
                    } else {
                        k.as_ref()[section.len() + 1..].to_string()
                    }
                }),
        );
        while let Some(key) = keys.pop() {
            if let Some(pos) = key.rfind('.') {
                let section = key.split_at(pos).0.to_string();
                if !keys.contains(&section) && !result.contains(&section) {
                    keys.push(section.clone());
                }
                result.insert(section.to_string());
            }
        }
        result
    }
fn section_tree ( & self , section : & str ) -> BTreeSet < String > where T : Clone , { // TODO: `keys` could be simplified if nightly feature map_first_last is // stabilized, see <https://github.com/rust-lang/rust/issues/62924> let mut keys = vec ! [ ] ; let mut result = BTreeSet :: new ( ) ; keys . extend ( self . clone ( ) . walk_tree ( section ) // ignore current section's name . map ( | ( k , _ ) | { if section . is_empty ( ) { k . as_ref ( ) . to_string ( ) } else { k . as_ref ( ) [ section . len ( ) + 1 .. ] . to_string ( ) } } ) , ) ; while let Some ( key ) = keys . pop ( ) { if let Some ( pos ) = key . rfind ( '.' ) { let section = key . split_at ( pos ) . 0 . to_string ( ) ; if ! keys . contains ( & section ) && ! result . contains ( & section ) { keys . push ( section . clone ( ) ) ; } result . insert ( section . to_string ( ) ) ; } } result }
Implements the `SectionTree` API function.
Implements the ` SectionTree ` API function .
&self
section
&str
&self
section
&str