From: Ian Jackson Date: Fri, 23 Jul 2021 21:58:13 +0000 (+0100) Subject: wip parsing X-Git-Tag: hippotat/1.0.0~515 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=02d6e55ad0dfab08a575c9ddf473bda55834b67d;p=hippotat.git wip parsing Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index e5c06cb..58ffd6c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -67,7 +67,7 @@ pub enum SectionName { } pub use SectionName as SN; -type SectionMap = HashMap>; +type SectionMap = HashMap>; pub struct Config { opts: Opts, @@ -137,7 +137,12 @@ impl Aggregate { // xxx parse section names here // xxx save Arc where we found each item - self.sections.extend(map.drain()); + for (sn, vars) in map.drain() { + let sn = sn.parse().dcontext(&sn)?; + self.sections.entry(sn) + .or_default() + .extend(vars); + } None }