# search_dir
A Rust library for finding the first matching item in a directory.
## Usage
Add the following to your `Cargo.toml`:
```toml
[dependencies]
futures="^0.3.21"
search_dir = "0.1"
```
## Example
```rust
use futures::executor::block_on;
use search_dir::search::{find_item, ItemType};
use std::env;
use std::fs;
fn main() -> std::io::Result<()> {
//creates directory we want to search
fs::create_dir_all("./some/awesome/really/cool/")?;
fs::write("./some/awesome/really/cool/hello.txt", "this is a file")?;
let current_dir = env::current_dir()?;
//searches for a directory called `dir`
let found_path = block_on(find_item(
current_dir.into(),
"hello.txt".to_string(),
ItemType::Directory,
))?;
println!("{:?}", found_path);
Ok(())
}
```
## License
This project is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)