~matthiasbeyer/imag

caa83f0d9d20426e18023c90d0a96771e2d2e2aa — Matthias Beyer 1 year, 11 months ago 13561d6
Use closure as suggested by clippy

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2 files changed, 3 insertions(+), 3 deletions(-)

M bin/domain/imag-todo/src/lib.rs
M bin/domain/imag-todo/src/util.rs
M bin/domain/imag-todo/src/lib.rs => bin/domain/imag-todo/src/lib.rs +1 -1
@@ 421,7 421,7 @@ fn show(rt: &Runtime) -> Result<()> {
            let sched    = util::get_dt_str(entry.get_scheduled(), "Not scheduled")?;
            let hidden   = util::get_dt_str(entry.get_hidden(), "Not hidden")?;
            let due      = util::get_dt_str(entry.get_due(), "No due")?;
            let priority = entry.get_priority().map_err(E::from)?.map(|p| p.as_str().to_string()).unwrap_or("No prio".to_string());
            let priority = entry.get_priority().map_err(E::from)?.map(|p| p.as_str().to_string()).unwrap_or_else(|| "No prio".to_string());

            let text     = entry.get_content().to_owned();


M bin/domain/imag-todo/src/util.rs => bin/domain/imag-todo/src/util.rs +2 -2
@@ 36,7 36,7 @@ use libimagutil::date::datetime_to_string;
pub fn get_dt_str(d: Result<Option<NaiveDateTime>>, s: &str) -> RResult<String, libimagentryview::error::Error> {
    Ok(d.map_err(libimagentryview::error::Error::from)?
       .map(|v| datetime_to_string(&v))
       .unwrap_or(s.to_string()))
       .unwrap_or_else(|| s.to_string()))
}

pub fn get_todo_print_format(config_value_path: &'static str, rt: &Runtime, scmd: &ArgMatches) -> Result<Handlebars> {


@@ 72,7 72,7 @@ pub fn build_data_object_for_handlebars(i: usize, todo: &Entry) -> Result<BTreeM
    let hidden   = get_dt_str(todo.get_hidden(), "Not hidden")?;
    let due      = get_dt_str(todo.get_due(), "No due")?;
    let priority = todo.get_priority().map_err(Error::from)?.map(|p| p.as_str().to_string())
            .unwrap_or("No prio".to_string());
            .unwrap_or_else(|| "No prio".to_string());

    data.insert("uuid"     , uuid);
    data.insert("status"   , status);