From e1dc925ecc9c9bd0be67bbb15937db6c470be13b Mon Sep 17 00:00:00 2001 From: krolxon Date: Thu, 13 Jun 2024 15:31:40 +0530 Subject: comply with clippy --- src/browser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/browser.rs') 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)?; } -- cgit v1.2.3