Merge pull request #1303 from matthiasbeyer/imag-diary/fix-list-diary-name-passing

Fix order of evaluation
This commit is contained in:
Matthias Beyer 2018-02-20 18:37:55 +01:00 committed by GitHub
commit c2b754dbec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,8 +26,10 @@ use toml_query::read::TomlValueReadExt;
pub fn get_diary_name(rt: &Runtime) -> Option<String> {
use libimagdiary::config::get_default_diary_name;
get_default_diary_name(rt)
.or(rt.cli().value_of("diaryname").map(String::from))
rt.cli()
.value_of("diaryname")
.map(String::from)
.or_else(|| get_default_diary_name(rt))
}
pub enum Timed {