diff options
| author | namilsk <namilsk@namilsk.tech> | 2026-02-02 22:33:30 +0300 |
|---|---|---|
| committer | namilsk <namilsk@namilsk.tech> | 2026-02-02 22:33:30 +0300 |
| commit | edf1c07498fca80e09579586aaa4dda914f088b5 (patch) | |
| tree | 020d29bbb41c2b65548293783610252f10c3b02a /init/src/kmods/load.rs | |
| parent | 913da896fcc161b138932655c3c7864cbde3d6a7 (diff) | |
Fixed `.unwrap()` call in units.rs, fixed all clippy warnings, refactor child exit-status check
Diffstat (limited to 'init/src/kmods/load.rs')
| -rw-r--r-- | init/src/kmods/load.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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<Vec<String>, Box<dyn std::error::Error>> { @@ -14,8 +13,8 @@ fn parse_modules() -> Result<Vec<String>, Box<dyn std::error::Error>> { pub fn load_modules() -> Result<(), Box<dyn std::error::Error>> { 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(()) |
