simple_fs/list/
iter_dirs.rs1use crate::{ListOptions, Result, SPath};
2
3use std::path::Path;
4
5pub fn iter_dirs(
8 dir: impl AsRef<Path>,
9 include_globs: Option<&[&str]>,
10 list_options: Option<ListOptions<'_>>,
11) -> Result<impl Iterator<Item = SPath>> {
12 let iter = super::globs_dir_iter::GlobsDirIter::new(dir, include_globs, list_options)?;
13 Ok(iter)
14}
15
16pub fn list_dirs(
18 dir: impl AsRef<Path>,
19 include_globs: Option<&[&str]>,
20 list_options: Option<ListOptions<'_>>,
21) -> Result<Vec<SPath>> {
22 let iter = iter_dirs(dir, include_globs, list_options)?;
23 Ok(iter.collect())
24}