Replace is_none() -> unwrap() with unwrap_or_else()
This commit is contained in:
parent
5e739df3f8
commit
f61e14ff41
1 changed files with 2 additions and 4 deletions
|
@ -13,12 +13,10 @@ use util::get_diary_name;
|
|||
pub fn delete(rt: &Runtime) {
|
||||
use libimaginteraction::ask::ask_bool;
|
||||
|
||||
let diaryname = get_diary_name(rt);
|
||||
if diaryname.is_none() {
|
||||
let diaryname = get_diary_name(rt).unwrap_or_else(|| {
|
||||
warn!("No diary selected. Use either the configuration file or the commandline option");
|
||||
exit(1);
|
||||
}
|
||||
let diaryname = diaryname.unwrap();
|
||||
});
|
||||
|
||||
let diary = Diary::open(rt.store(), &diaryname[..]);
|
||||
debug!("Diary opened: {:?}", diary);
|
||||
|
|
Loading…
Reference in a new issue