rework section loading

This commit is contained in:
timeshifter
2023-01-09 19:06:51 +01:00
parent 45f8f9a5d5
commit 03cc060d0f
8 changed files with 32 additions and 14 deletions
+13
View File
@@ -20,5 +20,18 @@ macro_rules! impl_backend_constants {
fn get_managed_packages(&self) -> &HashSet<Package> {
&self.packages
}
fn load(&mut self, groups: &HashSet<Group>) {
let own_section_name = self.get_section();
groups
.iter()
.flat_map(|g| &g.sections)
.filter(|section| section.name == own_section_name)
.flat_map(|section| &section.packages)
.for_each(|package| {
self.packages.insert(package.clone());
})
}
};
}