Replace is_none() -> unwrap() with unwrap_or_else()
This commit is contained in:
parent
b7c8fa4d18
commit
b2b8f013af
1 changed files with 2 additions and 4 deletions
|
@ -12,12 +12,10 @@ use libimagerror::trace::trace_error;
|
||||||
use util::get_diary_name;
|
use util::get_diary_name;
|
||||||
|
|
||||||
pub fn list(rt: &Runtime) {
|
pub fn list(rt: &Runtime) {
|
||||||
let diaryname = get_diary_name(rt);
|
let diaryname = get_diary_name(rt).unwrap_or_else(|| {
|
||||||
if diaryname.is_none() {
|
|
||||||
warn!("No diary selected. Use either the configuration file or the commandline option");
|
warn!("No diary selected. Use either the configuration file or the commandline option");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
});
|
||||||
let diaryname = diaryname.unwrap();
|
|
||||||
|
|
||||||
fn entry_to_location_listing_string(e: &Entry) -> String {
|
fn entry_to_location_listing_string(e: &Entry) -> String {
|
||||||
e.get_location().clone()
|
e.get_location().clone()
|
||||||
|
|
Loading…
Reference in a new issue