rust/hg-core/src/config/layer.rs
changeset 48388 a2e278b5e265
parent 47413 6e49769b7f97
child 48490 4a983b69e519
equal deleted inserted replaced
48387:f9db8eeb3aec 48388:a2e278b5e265
   123     pub fn iter_keys(&self, section: &[u8]) -> impl Iterator<Item = &[u8]> {
   123     pub fn iter_keys(&self, section: &[u8]) -> impl Iterator<Item = &[u8]> {
   124         self.sections
   124         self.sections
   125             .get(section)
   125             .get(section)
   126             .into_iter()
   126             .into_iter()
   127             .flat_map(|section| section.keys().map(|vec| &**vec))
   127             .flat_map(|section| section.keys().map(|vec| &**vec))
       
   128     }
       
   129 
       
   130     /// Returns whether any key is defined in the given section
       
   131     pub fn has_non_empty_section(&self, section: &[u8]) -> bool {
       
   132         self.sections
       
   133             .get(section)
       
   134             .map_or(false, |section| !section.is_empty())
   128     }
   135     }
   129 
   136 
   130     pub fn is_empty(&self) -> bool {
   137     pub fn is_empty(&self) -> bool {
   131         self.sections.is_empty()
   138         self.sections.is_empty()
   132     }
   139     }