about summary refs log tree commit diff
path: root/src/files.rs
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2021-09-21 23:55:00 +0200
committerMel <einebeere@gmail.com>2021-09-21 23:55:00 +0200
commitc96b464bed616d40f1204136c0c5a739fe6fe7ba (patch)
tree3d896f1a0b0b26434421ab2b7b93c9bc01abe06d /src/files.rs
parent2890afd3e45779b04681f0b26e0fc93e4133cd42 (diff)
downloadka-c96b464bed616d40f1204136c0c5a739fe6fe7ba.tar.zst
ka-c96b464bed616d40f1204136c0c5a739fe6fe7ba.zip
Fix clippy complaints
Diffstat (limited to 'src/files.rs')
-rw-r--r--src/files.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/files.rs b/src/files.rs
index 3b6e9cb..41dbad1 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -26,12 +26,12 @@ impl Locations {
             fs::read_dir(&self.ka_files_path).context("Failed reading history file entries.")?;
 
         let working_files = Self::walk_directory(working_entries, &|entry| {
-            FileState::from_working(&self, &entry.path()).ok()
+            FileState::from_working(self, &entry.path()).ok()
         })?;
 
         let deleted_files = Self::walk_directory(history_entries, &|entry| {
             let file_path = entry.path();
-            let file = FileState::from_history(&self, &file_path).ok()?;
+            let file = FileState::from_history(self, &file_path).ok()?;
             match file {
                 FileState::Deleted { .. } => Some(file),
                 FileState::Tracked { .. } => None,
@@ -68,10 +68,8 @@ impl Locations {
                 let nested_directory = fs::read_dir(entry.path())?;
                 let nested_files = Self::walk_directory(nested_directory, filter_map)?;
                 entries.extend(nested_files);
-            } else {
-                if let Some(states) = filter_map(entry) {
-                    entries.push(states);
-                }
+            } else if let Some(states) = filter_map(entry) {
+                entries.push(states);
             }
         }