style: code style

This commit is contained in:
2020-07-19 22:02:04 +08:00
parent 399ba16771
commit a4ec0c9d53

View File

@@ -60,10 +60,6 @@ fn main() {
}
}
fn is_verbose() -> bool {
if let Ok(v) = env::var("VERBOSE") { v == "1" } else { false }
}
fn print_usage() {
if let Some(usage) = get_commit_msg_usage() {
print_info(&usage); return;
@@ -185,6 +181,9 @@ fn install_commit_msg(force: bool) {
print_ok("Install commit-msg to repo successed!");
}
fn is_verbose() -> bool { if let Ok(v) = env::var("VERBOSE") { v == "1" } else { false } }
fn exit_with_error() -> ! { process::exit(1) }
fn exit_with_error_message(msg: &str) -> ! { print_error(msg); exit_with_error() }