ext_filter

Macro ext_filter 

Source
macro_rules! ext_filter {
    ($vis:vis $name:ident, $Ext:literal) => { ... };
}
Expand description

Creates a Filter type that only allows files / folders with a specific extension.

ยงExamples

use std::path::Path;
use dir_structure::dir_children::Filter;

dir_structure::ext_filter!(RustFile, "rs");

assert!(RustFile::allows(Path::new("main.rs")));
assert!(RustFile::allows(Path::new("src/a/b/mod.rs")));
assert!(!RustFile::allows(Path::new("main.txt")));