diff --git a/rust/src/main.rs b/rust/src/main.rs index 9293bc0..72ddf2c 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -121,15 +121,15 @@ fn iterator(input: &Path) -> impl Iterator { .into_iter() .filter_map(|e| e.ok()) .filter(|e| e.file_type().is_file()) + .filter(|e| !already_compressed(e.path())) .map(|e| e.path().to_owned()) - .filter(|e| !already_compressed(e)) } fn strip_input(path: &Path, input: &Path) -> PathBuf { path.strip_prefix(input).unwrap().to_owned() } -fn already_compressed(path: &PathBuf) -> bool { +fn already_compressed(path: &Path) -> bool { let p = path.to_string_lossy(); p.ends_with(".br") || p.ends_with(".gz") }