[mio] 去除获取目录失败的unwrap
This commit is contained in:
+2
-4
@@ -18,10 +18,8 @@ mod console_out;
|
||||
mod root_check;
|
||||
|
||||
pub fn app_home() -> io::Result<PathBuf> {
|
||||
let path = std::env::current_exe()
|
||||
.expect("current_exe error")
|
||||
.parent()
|
||||
.expect("current_exe parent error")
|
||||
let path = std::env::current_exe()?
|
||||
.parent().ok_or(io::Error::new(io::ErrorKind::Other,"current_exe parent error"))?
|
||||
.join("env");
|
||||
if !path.exists() {
|
||||
std::fs::create_dir_all(&path)?;
|
||||
|
||||
Reference in New Issue
Block a user