From: Ian Jackson Date: Sat, 24 Jul 2021 18:01:41 +0000 (+0100) Subject: config: fix some reporting X-Git-Tag: hippotat/1.0.0~465 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=d31bbeae2120db778ae4e1784cb0cc64bf64e305;p=hippotat.git config: fix some reporting Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 0582e12..83b1b1c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -126,6 +126,7 @@ pub use SectionName as SN; struct RawVal { raw: Option, loc: Arc } type SectionMap = HashMap; +#[derive(Debug)] struct RawValRef<'v,'l,'s> { raw: Option<&'v str>, key: &'static str, @@ -138,7 +139,7 @@ impl<'v> RawValRef<'v,'_,'_> { fn try_map(&self, f: F) -> T where F: FnOnce(Option<&'v str>) -> Result { f(self.raw) - .with_context(|| format!(r#"file {:?}, section "{:?}", key "{}"#, + .with_context(|| format!(r#"file {:?}, section "{:?}", key "{}""#, self.loc, self.section, self.key))? } }