From a5749a5d8d38b0db2ce5548473f8a61b674578a6 Mon Sep 17 00:00:00 2001 From: namilsk Date: Sat, 31 Jan 2026 21:26:26 +0300 Subject: Started writing service-utils and adding docstrings --- init/src/mounts/fstab.rs | 5 ++++- init/src/mounts/rescue.rs | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'init/src/mounts') diff --git a/init/src/mounts/fstab.rs b/init/src/mounts/fstab.rs index 4d9b474..7d71520 100644 --- a/init/src/mounts/fstab.rs +++ b/init/src/mounts/fstab.rs @@ -135,7 +135,10 @@ impl FstabEntry { pub fn mount(&self) -> Result<(), Box> { if let Err(e) = Self::check_mount_point_permissions(&self.mountpoint) { - log_warning(&format!("Permission check failed for {}: {}", self.mountpoint, e)); + log_warning(&format!( + "Permission check failed for {}: {}", + self.mountpoint, e + )); } log_success(&format!( diff --git a/init/src/mounts/rescue.rs b/init/src/mounts/rescue.rs index 2238297..385f851 100644 --- a/init/src/mounts/rescue.rs +++ b/init/src/mounts/rescue.rs @@ -13,10 +13,10 @@ fn check_mount_point_permissions(path: &str) -> Result<(), Box Result<(), Box> { // let source_c = source.map(|s| CString::new(s).map_err(|e| )); let source_c = match source { Some(s) => match CString::new(s) { - Ok(c_string) => Some(c_string), + Ok(c_string) => Some(c_string), Err(null_err) => { - log_warning(&format!("Source string contains NULL bytes (\\0), skipping: {}", null_err)); - continue; - } - }, - None => None - }; - + log_warning(&format!( + "Source string contains NULL bytes (\\0), skipping: {}", + null_err + )); + continue; + } + }, + None => None, + }; let source_ptr = source_c.as_ref().map_or(std::ptr::null(), |s| s.as_ptr()); -- cgit v1.2.3