walkr
recursively searches a directory for files matching a regex, and executes a closure you define, taking in a &DirEntry. This tiny crate allows you to find and operate on files quickly, making it convenient to quickly write tools performing file processing in Rust.
```rust match walkr::find(Path::new("./"), &"\.rs".toowned(), &|d| { println!("File: {:?} matched!", d.filename().into_string().unwrap());
// open the file and print the contents to stdout let mut f = File::open(d.path()).unwrap(); let mut s = String::new(); match f.readtostring(&mut s) { Ok() => { println!("{:?}", s); }, Err(e) => panic!(e) } }) { Ok() => println!("done"), Err(e) => panic!(e) } ```
Running this example:
cargo run ./src \.rs