equal
deleted
inserted
replaced
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 } |