mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-29 02:10:04 +08:00
match -> unwrap_or_else
This commit is contained in:
@@ -116,11 +116,8 @@ pub fn init_home_dir(home_sub_dir: &str) {
|
|||||||
|
|
||||||
pub fn init_dir(dir: &str) {
|
pub fn init_dir(dir: &str) {
|
||||||
if ! Path::new(dir).exists() {
|
if ! Path::new(dir).exists() {
|
||||||
match fs::create_dir_all(dir) {
|
fs::create_dir_all(dir).unwrap_or_else(|err| {
|
||||||
Ok(_) => (),
|
print_message(MessageType::ERROR, &format!("Init dir {} failed: {}", dir, err));
|
||||||
Err(err) => {
|
});
|
||||||
print_message(MessageType::ERROR, &format!("Init dir {} failed: {}", dir, err));
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user