From 670a0ff6d7b32898d79b56f266c20f74fed5ef58 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:52:06 +0200 Subject: [PATCH] [Auto] lib/etc/util: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- lib/etc/libimagutil/src/date.rs | 2 +- lib/etc/libimagutil/src/key_value_split.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/etc/libimagutil/src/date.rs b/lib/etc/libimagutil/src/date.rs index 21ee357b..dc9b7745 100644 --- a/lib/etc/libimagutil/src/date.rs +++ b/lib/etc/libimagutil/src/date.rs @@ -23,7 +23,7 @@ use chrono::format::ParseError; pub const NAIVE_DATE_STRING_FORMAT : &str = "%Y-%m-%d"; -pub fn date_to_string(ndt: &NaiveDate) -> String { +pub fn date_to_string(ndt: NaiveDate) -> String { ndt.format(NAIVE_DATE_STRING_FORMAT).to_string() } diff --git a/lib/etc/libimagutil/src/key_value_split.rs b/lib/etc/libimagutil/src/key_value_split.rs index ac25ccd4..7998556c 100644 --- a/lib/etc/libimagutil/src/key_value_split.rs +++ b/lib/etc/libimagutil/src/key_value_split.rs @@ -84,7 +84,7 @@ impl IntoKeyValue for String { }; key.and_then(|k| { - value.and_then(|v| Some(KeyValue::new(String::from(k.as_str()), String::from(v)))) + value.map(|v| KeyValue::new(String::from(k.as_str()), String::from(v))) }) }