From 6b5d91e4472dd74526da1b630ae71fdeb50d845d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 4 Sep 2016 17:58:01 +0200 Subject: [PATCH] Replace is_none() -> unwrap() with unwrap_or_else() --- imag-diary/src/view.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/imag-diary/src/view.rs b/imag-diary/src/view.rs index e96e0649..c214eafe 100644 --- a/imag-diary/src/view.rs +++ b/imag-diary/src/view.rs @@ -9,12 +9,11 @@ use libimagerror::trace::trace_error; use util::get_diary_name; pub fn view(rt: &Runtime) { - let diaryname = get_diary_name(rt); - if diaryname.is_none() { + let diaryname = get_diary_name(rt).unwrap_or_else(|| { warn!("No diary name"); exit(1); - } - let diaryname = diaryname.unwrap(); + }); + let diary = Diary::open(rt.store(), &diaryname[..]); let show_header = rt.cli().subcommand_matches("view").unwrap().is_present("show-header");