chiark / gitweb /
config
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 24 Jul 2021 12:50:40 +0000 (13:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 24 Jul 2021 12:50:40 +0000 (13:50 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs

index 3eae89d084d916fcb3291164ff59663fb97fb6e1..94c5e1620cadc63ddbc7f5ad33ad955ff424f359 100644 (file)
@@ -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)? ) => {