summaryrefslogtreecommitdiffstats
path: root/src/file/format/ini.rs
diff options
context:
space:
mode:
authorFabio Valentini <decathorpe@gmail.com>2020-12-09 23:45:51 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-03-14 08:58:05 +0100
commit010895c558ece3247b1ea8b0f90098c7bd254657 (patch)
treeace7248f6e3a5da94d425fa26b493908f1123470 /src/file/format/ini.rs
parent887736dc67740e5316a892bfcb569f62d0fc45da (diff)
Update dependency: rust-ini: 0.13 -> 0.16
Cherry picked, fixed merge conflict in Cargo.toml and ran cargo-fmt on the new tree. (cherry picked from commit 43ca83a4fa6ea55274f7c78a1914fe93476916ed) Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/file/format/ini.rs')
-rw-r--r--src/file/format/ini.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/file/format/ini.rs b/src/file/format/ini.rs
index e5a109f..bc51def 100644
--- a/src/file/format/ini.rs
+++ b/src/file/format/ini.rs
@@ -11,17 +11,23 @@ pub fn parse(
let mut map: HashMap<String, Value> = HashMap::new();
let i = Ini::load_from_str(text)?;
for (sec, prop) in i.iter() {
- match *sec {
- Some(ref sec) => {
+ match sec {
+ Some(sec) => {
let mut sec_map: HashMap<String, Value> = HashMap::new();
for (k, v) in prop.iter() {
- sec_map.insert(k.clone(), Value::new(uri, ValueKind::String(v.clone())));
+ sec_map.insert(
+ k.to_owned(),
+ Value::new(uri, ValueKind::String(v.to_owned())),
+ );
}
- map.insert(sec.clone(), Value::new(uri, ValueKind::Table(sec_map)));
+ map.insert(sec.to_owned(), Value::new(uri, ValueKind::Table(sec_map)));
}
None => {
for (k, v) in prop.iter() {
- map.insert(k.clone(), Value::new(uri, ValueKind::String(v.clone())));
+ map.insert(
+ k.to_owned(),
+ Value::new(uri, ValueKind::String(v.to_owned())),
+ );
}
}
}