diff options
author | Fabio Valentini <decathorpe@gmail.com> | 2020-12-09 23:45:51 +0100 |
---|---|---|
committer | Fabio Valentini <decathorpe@gmail.com> | 2021-03-18 10:56:07 +0100 |
commit | f9b70e838e957189c7ae256d59b9ab2970641899 (patch) | |
tree | 4aa00d86eb034b08a1969d5f636aa77347c02f91 /src | |
parent | 817b37807572418f48e3d660e3931d265e32ab28 (diff) |
port to rust-ini 0.16
Diffstat (limited to 'src')
-rw-r--r-- | src/file/format/ini.rs | 16 |
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())), + ); } } } |