Skip to content

Commit

Permalink
Move skip variable from previous commit outside of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
white-axe committed Oct 11, 2023
1 parent a2bf65f commit b503fd6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/filesystem/path_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ where
path: impl AsRef<camino::Utf8Path>,
f: &mut impl FnMut(&camino::Utf8Path),
) -> Result<(), Error> {
// In web builds, RTPs are currently to be placed in the "RTP" subdirectory of
// the project root directory, so this is to avoid loading the contents of
// those directories twice
let skip = matches!(path.as_ref().iter().next_back(), Some("RTP"));

for entry in fs.read_dir(path)? {
f(entry.path());

// In web builds, RTPs are currently to be placed in the "RTP" subdirectory of
// the project root directory, so this is to avoid loading the contents of
// those directories twice
let skip = matches!(entry.path().iter().nth_back(1), Some("RTP"));

if !skip && !entry.metadata().is_file {
internal(fs, entry.path(), f)?;
}
Expand Down

0 comments on commit b503fd6

Please sign in to comment.