Refactor prefetch_project_files function for improved readability

- Simplified the iteration over directory entries in the `prefetch_project_files` function by using `into_iter().flatten()` instead of a nested loop.
- This change enhances code clarity while maintaining the existing functionality of collecting valid directory entries.

These modifications aim to streamline the code and improve maintainability in the prefetching process.
This commit is contained in:
Joe 2026-02-19 02:27:36 -06:00
parent 0462b91a6c
commit 5a943c33ea
2 changed files with 3 additions and 5 deletions

View file

@ -152,10 +152,8 @@ fn prefetch_project_files(project: &Project) -> io::Result<PrefetchCache> {
if !root.exists() {
continue;
}
for entry in WalkDir::new(root).follow_links(true) {
if let Ok(e) = entry {
entries.push(e);
}
for e in WalkDir::new(root).follow_links(true).into_iter().flatten() {
entries.push(e);
}
}