mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-29 18:30:05 +08:00
update get_user_home
This commit is contained in:
@@ -81,13 +81,12 @@ pub fn calc_file_sha256(file_name: &str) -> XResult<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_user_home() -> XResult<String> {
|
pub fn get_user_home() -> XResult<String> {
|
||||||
let home_dir_o = match dirs::home_dir() {
|
match dirs::home_dir() {
|
||||||
None => return Err(new_box_error("Home dir not found!")),
|
None => Err(new_box_error("Home dir not found!")),
|
||||||
Some(home_dir_o) => home_dir_o,
|
Some(home_dir_o) => match home_dir_o.to_str() {
|
||||||
};
|
None => Err(new_box_error("Home dir not found!")),
|
||||||
match home_dir_o.to_str() {
|
|
||||||
None => return Err(new_box_error("Home dir not found!")),
|
|
||||||
Some(home_dir_str) => Ok(home_dir_str.to_string()),
|
Some(home_dir_str) => Ok(home_dir_str.to_string()),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user