diff --git a/src/validate.rs b/src/validate.rs index c8f4ecb..231868e 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -14,7 +14,27 @@ pub fn validate(verbosity: u8, config: util::config::Config) { // make sure each has a match } -fn get_dir_files(path: PathBuf) -> Result, &'static str> {} +fn get_dir_files(path: PathBuf) -> Result, &'static str> { + let mut res: Vec; + + // get the readout of the path for error handling + let entries = match fs::read_dir(path) { + Ok(x) => x, + Err(error) => return Err("Failed to read from the given directory"), + }; + + for entry in entries { + let p = entry.expect("Bad element: validate::get_dir_files(..)"); + if p.path().is_dir() { + (); + } else { + res.push(p.path()); + } + } + + return Ok(res); +} + fn check_suffix(path: PathBuf, suf: String) -> bool { return