mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-29 18:30:05 +08:00
match -> unwrap_or_else
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -112,13 +112,9 @@ fn do_with_buildin_arg_builder(first_arg: &str, args: &Vec<String>, builder_name
|
|||||||
for i in from_index..args.len() {
|
for i in from_index..args.len() {
|
||||||
cmd.arg(&args[i]);
|
cmd.arg(&args[i]);
|
||||||
}
|
}
|
||||||
match run_command_and_wait(&mut cmd) {
|
run_command_and_wait(&mut cmd).unwrap_or_else(|err| {
|
||||||
Err(err) => {
|
print_message(MessageType::ERROR, &format!("Run build command failed: {}", err));
|
||||||
print_message(MessageType::ERROR, &format!("Run build command failed: {}", err));
|
});
|
||||||
return;
|
|
||||||
},
|
|
||||||
Ok(_) => (),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_with_buildin_args(args: &Vec<String>) {
|
fn do_with_buildin_args(args: &Vec<String>) {
|
||||||
@@ -222,11 +218,7 @@ fn main() {
|
|||||||
for i in 1..args.len() {
|
for i in 1..args.len() {
|
||||||
cmd.arg(&args[i]);
|
cmd.arg(&args[i]);
|
||||||
}
|
}
|
||||||
match run_command_and_wait(&mut cmd) {
|
run_command_and_wait(&mut cmd).unwrap_or_else(|err| {
|
||||||
Err(err) => {
|
print_message(MessageType::ERROR, &format!("Run build command failed: {}", err));
|
||||||
print_message(MessageType::ERROR, &format!("Run build command failed: {}", err));
|
});
|
||||||
return;
|
|
||||||
},
|
|
||||||
Ok(_) => (),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user