diff --git a/native/src/base/argh.rs b/native/src/base/argh.rs index 020a75a43..915b61757 100644 --- a/native/src/base/argh.rs +++ b/native/src/base/argh.rs @@ -1221,6 +1221,6 @@ mod argh_shared { fn new_line(current_line: &mut String, out: &mut String) { out.push('\n'); out.push_str(current_line); - current_line.truncate(0); + current_line.clear(); } } diff --git a/native/src/core/mount.rs b/native/src/core/mount.rs index b37b05956..486200b46 100644 --- a/native/src/core/mount.rs +++ b/native/src/core/mount.rs @@ -140,11 +140,8 @@ pub fn find_preinit_device() -> String { if !info.fs_option.split(',').any(|s| s == "rw") { return None; } - if let Some(path) = Path::new(&info.source).parent() { - if !path.ends_with("by-name") && !path.ends_with("block") { - return None; - } - } else { + let path = Path::new(&info.source).parent()?; + if !path.ends_with("by-name") && !path.ends_with("block") { return None; } // use device major number to filter out device-mapper