diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2019-02-15 19:13:42 -0800 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2019-02-15 19:37:29 -0800 |
commit | 8b04fec104cd20b86ff98f4da225bb866a407f8c (patch) | |
tree | f9b58da3f2a107d136a66c61d08dead883965864 /src/history.rs | |
parent | 055ac602929af367da2af77999e73de6bf8fd344 (diff) |
Fix most clippy lints
Diffstat (limited to 'src/history.rs')
-rw-r--r-- | src/history.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/history.rs b/src/history.rs index 8f0a270..bc1fe7c 100644 --- a/src/history.rs +++ b/src/history.rs @@ -18,7 +18,7 @@ impl DirHistory { pub fn populate_to_root(&mut self, pathbuf: &PathBuf, sort_type: &sort::SortType) { let mut ancestors = pathbuf.ancestors(); if let Some(mut ancestor) = ancestors.next() { - while let Some(curr) = ancestors.next() { + for curr in ancestors { match structs::JoshutoDirList::new(curr.to_path_buf().clone(), sort_type) { Ok(mut s) => { for (i, dirent) in s.contents.iter().enumerate() { @@ -49,7 +49,7 @@ impl DirHistory { Ok(dir_entry) } None => { - let path_clone = path.clone().to_path_buf(); + let path_clone = path.to_path_buf(); structs::JoshutoDirList::new(path_clone, &sort_type) } } @@ -69,8 +69,7 @@ impl DirHistory { } } Entry::Vacant(entry) => { - if let Ok(s) = structs::JoshutoDirList::new(path.clone().to_path_buf(), &sort_type) - { + if let Ok(s) = structs::JoshutoDirList::new(path.to_path_buf(), &sort_type) { entry.insert(s); } } |