From 6e2e67f0869f6a2efdb5539b71cfa49d49da1863 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Mon, 18 Mar 2024 16:35:25 +0900 Subject: [PATCH] Refactor macro More minor refactoring of macro introduced 3 commits ago. --- src/helper.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helper.rs b/src/helper.rs index 859997b..32e3205 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -6,15 +6,15 @@ macro_rules! cleanup_func { $(var_pair: $orig_var:expr, $new_var:ident),*) => { $(let $new_var = $orig_var;)* - struct $name ()> { + struct $name { func: T, } - impl Drop for $name where T: Fn() -> () { + impl Drop for $name where T: Fn() { fn drop(&mut self) { (self.func)(); } } - impl $name where T: Fn() -> () { + impl $name where T: Fn() { fn new(func: T) -> Self { Self { func,