mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2024-11-28 05:45:48 +00:00
use shorthand constraint syntax and formatting
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
a388c2e06e
commit
611f09829e
|
@ -1,17 +1,11 @@
|
|||
#[macro_export]
|
||||
macro_rules! defer {
|
||||
($body:block) => {
|
||||
struct _Defer_<F>
|
||||
where
|
||||
F: FnMut(),
|
||||
{
|
||||
struct _Defer_<F: FnMut()> {
|
||||
closure: F,
|
||||
}
|
||||
|
||||
impl<F> Drop for _Defer_<F>
|
||||
where
|
||||
F: FnMut(),
|
||||
{
|
||||
impl<F: FnMut()> Drop for _Defer_<F> {
|
||||
fn drop(&mut self) { (self.closure)(); }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue