diff --git a/src/file/format/ini.rs b/src/file/format/ini.rs index 9cd6b9fa..f7a25a5c 100644 --- a/src/file/format/ini.rs +++ b/src/file/format/ini.rs @@ -24,14 +24,15 @@ fn from_ini( ) -> Value { let mut map = Map::::new(); - let mut sections: Map, Table> = data.into_iter().map(|(section, props)| {( - section, - props.iter().map(|(k, v)| { + let mut sections: Map, Table> = data.into_iter().map(|(section, props)| { + let key = section; + let value = props.iter().map(|(k, v)| { let key = k.to_owned(); let value = Value::new(uri, ValueKind::String(v.to_owned())); (key, value) - }).collect() - )}).collect(); + }).collect(); + (key, value) + }).collect(); // Hoist (optional) sectionless properties to the top-level, alongside sections: map.extend(sections.remove(&None).unwrap_or_default());