revme/dir_utils.rs
1use std::path::{Path, PathBuf};
2use walkdir::{DirEntry, WalkDir};
3
4pub fn find_all_json_tests(path: &Path) -> Vec<PathBuf> {
5 WalkDir::new(path)
6 .into_iter()
7 .filter_map(|e| e.ok())
8 .filter(|e| {
9 e.path()
10 .extension()
11 .map(|ext| ext == "json")
12 .unwrap_or(false)
13 })
14 .map(DirEntry::into_path)
15 .collect::<Vec<PathBuf>>()
16}