kilork.github.io

path-matchers

A small trait over plain paths and glob expressions.

Every tool that watches, ignores or copies files ends up with a matcher: this extension is ignored, that directory is included. Writing it again in every project is how subtle bugs get in.

What changes for you

Getting it

cargo add path-matchers
use path_matchers::{glob, PathMatcher};

let best_images = glob("images/**/best.*")?;
assert!(best_images.matches(&PathBuf::from("images/small/32x32/best.jpg")));

Where to look

source · crate