From 55d97e565d835d0580d8abb631ede1ec5aa252a7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 12 Jan 2018 16:30:33 +0100 Subject: [PATCH] imag-log: Replace read with typed read --- bin/domain/imag-log/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs index a4b143bb..1cb7291b 100644 --- a/bin/domain/imag-log/src/main.rs +++ b/bin/domain/imag-log/src/main.rs @@ -136,6 +136,7 @@ fn show(rt: &Runtime) { fn get_diary_name(rt: &Runtime) -> String { use toml_query::read::TomlValueReadExt; + use toml_query::read::TomlValueReadTypeExt; let cfg = rt .config() @@ -160,15 +161,13 @@ fn get_diary_name(rt: &Runtime) -> String { .into_iter() .map(Value::as_str) .map(Option::unwrap) - .collect::>(); + .map(String::from) + .collect::>(); let current_log = cfg - .read("log.default") + .read_string("log.default") .map_err_trace_exit_unwrap(1) .ok_or(LE::from("Configuration missing: 'log.default'")) - .map_err_trace_exit_unwrap(1) - .as_str() - .ok_or(LE::from("Configuration 'log.default' is not a String")) .map_err_trace_exit_unwrap(1); if !logs.contains(¤t_log) {