From: Ian Jackson Date: Sat, 24 Jul 2021 12:50:40 +0000 (+0100) Subject: config X-Git-Tag: hippotat/1.0.0~482 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=51ef02a8819cefb1556814bf65dc5ba428b581d4;p=hippotat.git config Signed-off-by: Ian Jackson --- 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)? ) => {