mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
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:
parent
0462b91a6c
commit
5a943c33ea
2 changed files with 3 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue