1
0
Fork 0
forked from wry/wry
wry/src/gfx_apis/vulkan/util.rs
2024-02-08 15:24:02 +01:00

17 lines
269 B
Rust

use std::mem;
pub struct OnDrop<F>(pub F)
where
F: FnMut() + Copy;
impl<F: FnMut() + Copy> OnDrop<F> {
pub fn forget(self) {
mem::forget(self);
}
}
impl<F: FnMut() + Copy> Drop for OnDrop<F> {
fn drop(&mut self) {
(self.0)();
}
}