use std::path::{Path, PathBuf}; pub const EXT_TOML: &str = ".toml"; pub const EXT_LOCK: &str = ".lock"; pub fn expand_files>(path: P) -> std::io::Result> { let path = path.as_ref(); if path.is_file() { return Ok(vec![path.to_path_buf()]); } Ok(std::fs::read_dir(path)? .filter_map(|entry| { let path = entry.ok()?.path(); if path.is_dir() { Some(expand_files(path).ok()?) } else { Some(vec![path]) } }) .flatten() .collect()) }