~danyspin97/initrz

968b41d792d266384f3e48450af9abbd75f95b9e — Danilo Spinella 5 months ago ab15e2c
initrz: Replace for with iterators in ModuleLoader
1 files changed, 6 insertions(+), 3 deletions(-)

M src/initrz/src/module_loader.rs
M src/initrz/src/module_loader.rs => src/initrz/src/module_loader.rs +6 -3
@@ 154,9 154,12 @@ impl ModuleLoader {
                return Ok(false);
            }
            let module = module.unwrap();
            for dep in &module.deps {
                self.load_module(&dep)?;
            }
            // Some modules could be builtin, do not block
            module
                .deps
                .iter()
                .map(|dep| -> Result<bool> { self.load_module(&dep) })
                .collect::<Result<Vec<_>>>()?;
            let mut modules_loaded = self.modules_loaded.write().unwrap();
            if !modules_loaded.contains(module_name) {
                modules_loaded.insert(String::from(module_name));