chore: use less mut variable

This commit is contained in:
2020-11-08 19:38:17 +08:00
parent 6bd539cdbd
commit 9a4af87669

View File

@@ -54,9 +54,8 @@ fn main() {
}));
let keep_running_config = opt_value!(parse_keep_running_config());
let mut the_file_lock = None;
if let Some(ref lock_file) = keep_running_config.lock_file {
the_file_lock = match FileLock::lock(lock_file, false, true) {
let the_file_lock = if let Some(ref lock_file) = keep_running_config.lock_file {
match FileLock::lock(lock_file, false, true) {
Ok(lock) => {
info!("Lock file success: {}", lock_file);
Some(lock)
@@ -65,8 +64,8 @@ fn main() {
warn!("Lock file failed: {}", lock_file);
return;
},
};
}
}
} else { None };
init_logger();