diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-06-13 15:31:40 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-06-13 15:31:40 +0530 |
| commit | e1dc925ecc9c9bd0be67bbb15937db6c470be13b (patch) | |
| tree | cbeb6b368799acfb5a66a80a32c587235b1eec97 /src/browser.rs | |
| parent | 3862d5d32458582e612d3b5d88c4a9174fc3fafc (diff) | |
comply with clippy
Diffstat (limited to 'src/browser.rs')
| -rwxr-xr-x | src/browser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/browser.rs b/src/browser.rs index 92d3ca9..8bbd12a 100755 --- a/src/browser.rs +++ b/src/browser.rs @@ -32,7 +32,7 @@ impl FileBrowser { let mut file_vec: Vec<(String, String)> = vec![]; let mut dir_vec: Vec<(String, String)> = vec![]; for (t, f) in conn.conn.listfiles(self.path.as_str())?.into_iter() { - if t == "directory" && !f.starts_with(".") { + if t == "directory" && !f.starts_with('.') { dir_vec.push((t, f)); } else if t == "file" && Path::new(&f).has_extension(&[ @@ -73,7 +73,7 @@ impl FileBrowser { .lsinfo(Song { file: (self.path.clone() + "/" + song) .strip_prefix("./") - .unwrap_or_else(|| "") + .unwrap_or("") .to_string(), ..Default::default() }) @@ -121,7 +121,7 @@ impl FileBrowser { self.update_directory(conn)?; } } else { - self.path = self.prev_path.clone(); + self.path.clone_from(&self.prev_path); self.update_directory(conn)?; } |
