chore: use less mut variable
This commit is contained in:
@@ -54,9 +54,8 @@ fn main() {
|
|||||||
}));
|
}));
|
||||||
let keep_running_config = opt_value!(parse_keep_running_config());
|
let keep_running_config = opt_value!(parse_keep_running_config());
|
||||||
|
|
||||||
let mut the_file_lock = None;
|
let the_file_lock = if let Some(ref lock_file) = keep_running_config.lock_file {
|
||||||
if let Some(ref lock_file) = keep_running_config.lock_file {
|
match FileLock::lock(lock_file, false, true) {
|
||||||
the_file_lock = match FileLock::lock(lock_file, false, true) {
|
|
||||||
Ok(lock) => {
|
Ok(lock) => {
|
||||||
info!("Lock file success: {}", lock_file);
|
info!("Lock file success: {}", lock_file);
|
||||||
Some(lock)
|
Some(lock)
|
||||||
@@ -65,8 +64,8 @@ fn main() {
|
|||||||
warn!("Lock file failed: {}", lock_file);
|
warn!("Lock file failed: {}", lock_file);
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
} else { None };
|
||||||
|
|
||||||
init_logger();
|
init_logger();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user