RustPhysicsMQ/src/helpers.rs

12 lines
272 B
Rust
Raw Normal View History

use std::fs;
use std::path::{Path, PathBuf};
pub fn list_files(dir: &str) -> Vec<PathBuf> {
fs::read_dir(dir)
.expect("Failed to read directory")
.filter_map(|e| e.ok())
.map(|e| e.path())
.filter(|p| p.is_file())
.collect()
}