Skip to content

Commit

Permalink
review fix: allow filter_files_with_extension to work with case-sensi…
Browse files Browse the repository at this point in the history
…tive extensions
  • Loading branch information
shamardy committed Sep 6, 2024
1 parent 9857170 commit 1de62ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm2src/mm2_io/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ where
}

async fn filter_files_with_extension(dir_path: &Path, extension: &str) -> IoResult<Vec<PathBuf>> {
let ext = Some(OsStr::new(extension));
let ext = Some(OsStr::new(extension).to_ascii_lowercase());
let entries = read_dir_async(dir_path)
.await?
.into_iter()
.filter(|path| path.extension() == ext)
.filter(|path| path.extension().map(|ext| ext.to_ascii_lowercase()) == ext)
.collect();
Ok(entries)
}
Expand Down

0 comments on commit 1de62ac

Please sign in to comment.