~danyspin97/initrz

2ebce9533f9385a9beeb6710e103257b7e8a2ff6 — Danilo Spinella 5 months ago 2ec1e50
initrz: Simplify iterator usage in module_loader
1 files changed, 4 insertions(+), 5 deletions(-)

M src/initrz/src/module_loader.rs
M src/initrz/src/module_loader.rs => src/initrz/src/module_loader.rs +4 -5
@@ 156,11 156,10 @@ impl ModuleLoader {
            }
            let module = module.unwrap();
            // Some modules could be builtin, do not block
            module
                .deps
                .iter()
                .map(|dep| -> Result<bool> { self.load_module(&dep) })
                .collect::<Result<Vec<_>>>()?;
            module.deps.iter().try_for_each(|dep| -> Result<()> {
                self.load_module(&dep)?;
                Ok(())
            })?;
            let mut modules_loaded = self.modules_loaded.write().unwrap();
            if !modules_loaded.contains(module_name) {
                modules_loaded.insert(String::from(module_name));