Skip to content

Commit ff60fb6

Browse files
committed
chore: Expand KV tuple for improved readability
Signed-off-by: Brennan Kinney <[email protected]>
1 parent 8ace2cd commit ff60fb6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/file/format/ini.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ fn from_ini(
2424
) -> Value {
2525
let mut map = Map::<String, Value>::new();
2626

27-
let mut sections: Map<Option<&str>, Table> = data.into_iter().map(|(section, props)| {(
28-
section,
29-
props.iter().map(|(k, v)| {
27+
let mut sections: Map<Option<&str>, Table> = data.into_iter().map(|(section, props)| {
28+
let key = section;
29+
let value = props.iter().map(|(k, v)| {
3030
let key = k.to_owned();
3131
let value = Value::new(uri, ValueKind::String(v.to_owned()));
3232
(key, value)
33-
}).collect()
34-
)}).collect();
33+
}).collect();
34+
(key, value)
35+
}).collect();
3536

3637
// Hoist (optional) sectionless properties to the top-level, alongside sections:
3738
map.extend(sections.remove(&None).unwrap_or_default());

0 commit comments

Comments
 (0)