Various cleanups

This commit is contained in:
Sergey Smirnykh
2019-10-02 16:25:33 +02:00
committed by Kenny Levinsen
parent c695288d1e
commit 29252cbbc6
2 changed files with 44 additions and 41 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ impl Desktop {
enabled_escape: false,
},
)?;
match file.section(Some("Desktop Entry").to_owned()) {
match file.section(Some("Desktop Entry")) {
Some(desktop) => Ok(Desktop {
entry_type: desktop.get("Type").unwrap_or(&"".to_string()).to_string(),
name: desktop.get("Name").unwrap_or(&"".to_string()).to_string(),
@@ -45,7 +45,7 @@ impl Desktop {
}
fn parse_dir(d: &str) -> Result<Vec<Desktop>, Box<dyn Error>> {
let mut files: Vec<Desktop> = Vec::new();
let mut files: Vec<Desktop> = Vec::with_capacity(16);
for entry in fs::read_dir(d)? {
let entry = entry?;
let path = entry.path();