# run-on-drop
[](http://crates.io/crates/run-on-drop)
[](http://docs.rs/run-on-drop)

This crate provides a closure wrapper that will run the closure when it is dropped.
## Example
```rust
use run_on_drop::on_drop;
let object = create_object();
let cleanup = on_drop(|| destroy_object(&object));
initialize_object(&object); // might unwind
cleanup.forget();
return object;
```
## MSRV
The MSRV is `max(stable - 3)`.
## License
This project is licensed under either of
- Apache License, Version 2.0
- MIT License
at your option.