From 683de0dd0d954cc95e60cc61baff71e5ece77a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun=20=28Dherse=29?= Date: Fri, 7 Jun 2024 12:05:46 +0200 Subject: [PATCH] cargo fmt --- macros/src/memoize.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/macros/src/memoize.rs b/macros/src/memoize.rs index 8f485c3..a145141 100644 --- a/macros/src/memoize.rs +++ b/macros/src/memoize.rs @@ -146,19 +146,20 @@ fn process(function: &Function) -> Result { let param_redefinitions = function.args.iter().filter_map(|arg| match arg { Argument::Receiver(_) => None, - Argument::Ident(_, mutability, ident) => Some(quote! { let #mutability #ident = #ident; }), + Argument::Ident(_, mutability, ident) => { + Some(quote! { let #mutability #ident = #ident; }) + } }); // Bypass for disabled memoization. - let bypass = function - .enabled - .as_ref() - .map(|enabled| quote! { + let bypass = function.enabled.as_ref().map(|enabled| { + quote! { if !(#enabled) { #(#param_redefinitions)* return #body; } - }); + } + }); wrapped.block = parse_quote! { { static __CACHE: ::comemo::internal::Cache<