From 02d6e55ad0dfab08a575c9ddf473bda55834b67d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 23 Jul 2021 22:58:13 +0100 Subject: [PATCH] wip parsing Signed-off-by: Ian Jackson --- src/config.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 } -- 2.30.2