Skip to content

Commit 63ce9dc

Browse files
committed
chore: sync
1 parent 2ba5a00 commit 63ce9dc

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/fs_service/search/files.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ impl FileSystemService {
158158
.filter(|e| e.file_type().is_file()); // Only files
159159

160160
for entry in entries {
161-
if let Ok(metadata) = entry.metadata() {
162-
if let Some(path_str) = entry.path().to_str() {
163-
size_map
164-
.entry(metadata.len())
165-
.or_default()
166-
.push(path_str.to_string());
167-
}
161+
if let Ok(metadata) = entry.metadata()
162+
&& let Some(path_str) = entry.path().to_str()
163+
{
164+
size_map
165+
.entry(metadata.len())
166+
.or_default()
167+
.push(path_str.to_string());
168168
}
169169
}
170170

src/fs_service/search/tree.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ impl FileSystemService {
6767
*current_count += 1;
6868

6969
// Check if we've exceeded max_files (if set)
70-
if let Some(max) = max_files {
71-
if *current_count > max {
72-
continue; // Skip this entry but continue processing others
73-
}
70+
if let Some(max) = max_files
71+
&& *current_count > max
72+
{
73+
continue; // Skip this entry but continue processing others
7474
}
7575

7676
let mut json_entry = json!({
@@ -191,10 +191,8 @@ impl FileSystemService {
191191
.filter_map(|e| e.ok())
192192
.all(|e| !e.file_type().is_file() || is_system_metadata_file(e.file_name())); // Directory is empty if no files are found in it or subdirs, ".DS_Store" will be ignores on Mac
193193

194-
if is_empty {
195-
if let Some(path_str) = entry.path().to_str() {
196-
empty_dirs.push(path_str.to_string());
197-
}
194+
if is_empty && let Some(path_str) = entry.path().to_str() {
195+
empty_dirs.push(path_str.to_string());
198196
}
199197
}
200198

0 commit comments

Comments
 (0)