Ban all unwrap usage in codebase

This commit is contained in:
topjohnwu
2025-12-08 23:31:04 -08:00
committed by John Wu
parent 200665c48a
commit ff4ca74cfe
24 changed files with 138 additions and 89 deletions
+3 -3
View File
@@ -10,6 +10,7 @@ use nix::mount::MsFlags;
use nix::sys::stat::{Mode, SFlag, mknod};
use num_traits::AsPrimitive;
use std::cmp::Ordering::{Greater, Less};
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
pub fn setup_preinit_dir() {
@@ -203,9 +204,8 @@ pub fn find_preinit_device() -> String {
}
Path::new(&info.source)
.file_name()
.unwrap()
.to_str()
.unwrap()
.and_then(OsStr::to_str)
.unwrap_or_default()
.to_string()
}