run-on-drop
This crate provides a closure wrapper that will run the closure when it is dropped.
Example
use on_drop;
let object = create_object;
let cleanup = on_drop;
initialize_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.