From 611f09829efd839ea290e8806ac43dfcd19aa0f6 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 5 Jul 2024 08:48:24 +0000 Subject: [PATCH] use shorthand constraint syntax and formatting Signed-off-by: Jason Volk --- src/core/utils/defer.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/utils/defer.rs b/src/core/utils/defer.rs index 2762d4fa..9d42e679 100644 --- a/src/core/utils/defer.rs +++ b/src/core/utils/defer.rs @@ -1,17 +1,11 @@ #[macro_export] macro_rules! defer { ($body:block) => { - struct _Defer_ - where - F: FnMut(), - { + struct _Defer_ { closure: F, } - impl Drop for _Defer_ - where - F: FnMut(), - { + impl Drop for _Defer_ { fn drop(&mut self) { (self.closure)(); } }