gix_fs/
read_dir.rs

1pub use gix_features::fs::read_dir::DirEntry;
2
3pub(crate) mod function {
4    use std::path::Path;
5
6    /// List all entries in `path`, similar to [`std::fs::read_dir()`], and assure all available information
7    /// adheres to the value of `precompose_unicode`.
8    pub fn read_dir(
9        path: &Path,
10        precompose_unicode: bool,
11    ) -> std::io::Result<impl Iterator<Item = std::io::Result<super::DirEntry>>> {
12        std::fs::read_dir(path)
13            .map(move |it| it.map(move |res| res.map(|entry| super::DirEntry::new(entry, precompose_unicode))))
14    }
15}