# util-easy
Small utility helpers for common tasks.
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
util-easy = "0.1.0"
```
## Filesystem Helpers
`util_easy::fs` provides small wrappers around common filesystem operations:
- `ensure_dir_exists(path)` creates a directory and its parents if needed.
- `ensure_parent_dir_exists(path)` creates the parent directory for a file path if needed.
- `remove_file_if_exists(path)` removes a file and succeeds if it is already missing.
- `remove_dir_all_if_exists(path)` removes a directory recursively and succeeds if it is already missing.
```rust
use util_easy::fs::{ensure_parent_dir_exists, remove_file_if_exists};
fn main() -> std::io::Result<()> {
let path = "output/example.txt";
ensure_parent_dir_exists(path)?;
std::fs::write(path, "hello")?;
remove_file_if_exists(path)?;
Ok(())
}
```
## License
Licensed under either of:
- Apache License, Version 2.0
- MIT license
at your option.