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))) }) }