From: Ian Jackson Date: Sat, 1 Feb 2025 12:16:00 +0000 (+0000) Subject: config: parseable_from_str: always provide default_or_ordinary X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=351fd085b14eda86826f8e248d39ff3632dd4ab6;p=hippotat.git config: parseable_from_str: always provide default_or_ordinary None of the call sites don't do this. Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 9ff2d83..4d31309 100644 --- a/src/config.rs +++ b/src/config.rs @@ -630,11 +630,11 @@ impl Parseable for Duration { Duration::from_secs( s.value()?.parse()? ) } } -macro_rules! parseable_from_str { ($t:ty $(, $def:expr)? ) => { +macro_rules! parseable_from_str { ($t:ty, $def:expr) => { impl Parseable for $t { #[throws(AE)] fn parse(s: Option<&str>) -> $t { s.value()?.parse()? } - $( #[throws(AE)] fn default_for_ordinary() -> Self { $def } )? + #[throws(AE)] fn default_for_ordinary() -> Self { $def } } } } parseable_from_str!{u16, default() }