From edf1c07498fca80e09579586aaa4dda914f088b5 Mon Sep 17 00:00:00 2001 From: namilsk Date: Mon, 2 Feb 2026 22:33:30 +0300 Subject: Fixed `.unwrap()` call in units.rs, fixed all clippy warnings, refactor child exit-status check --- init/src/kmods/load.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'init/src/kmods/load.rs') diff --git a/init/src/kmods/load.rs b/init/src/kmods/load.rs index 374ce36..8ff0a59 100644 --- a/init/src/kmods/load.rs +++ b/init/src/kmods/load.rs @@ -1,5 +1,4 @@ -use liblmod::Selection; -use liblmod::modprobe; +use liblmod::{modprobe, Selection}; use std::fs; fn parse_modules() -> Result, Box> { @@ -14,8 +13,8 @@ fn parse_modules() -> Result, Box> { pub fn load_modules() -> Result<(), Box> { let modules = parse_modules()?; - for i in 0..modules.len() { - modprobe(modules[i].to_string(), "".to_string(), Selection::Current)?; + for kmod in &modules { + modprobe(kmod.to_string(), "".to_string(), Selection::Current)?; } Ok(()) -- cgit v1.2.3