diff options
Diffstat (limited to 'src/file/format/ini.rs')
-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())), + ); } } } |