From 51ef02a8819cefb1556814bf65dc5ba428b581d4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 24 Jul 2021 13:50:40 +0100 Subject: [PATCH] config Signed-off-by: Ian Jackson --- src/config.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 3eae89d..94c5e16 100644 --- a/src/config.rs +++ b/src/config.rs @@ -302,9 +302,8 @@ trait Parseable: Sized { impl Parseable for Duration { #[throws(AE)] fn parse(s: Option<&str>) -> Duration { - let s = s.value()?; - if let Ok(u64) = s.parse() { return Duration::from_secs(u64) } - throw!(anyhow!("xxx parse with humantime")) + // todo: would be nice to parse with humantime maybe + Duration::from_secs( s.value()?.parse()? ) } } macro_rules! parseable_from_str { ($t:ty $(, $def:expr)? ) => { -- 2.30.2