Skip to main content

pubhubs/misc/
defer.rs

1//! Implementation of [`defer`]
2
3/// Defers the execution of `f` until the return value is dropped.
4#[must_use]
5pub fn defer(f: impl FnOnce()) -> impl Drop {
6    crate::misc::drop_ext::Bomb::new(f)
7}