From 12e7b65883a22030039806c41e704c27731e8dd9 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 2 May 2026 22:57:18 +0800 Subject: Add Display derive and testing utilities for Next enum --- mingling_macros/src/renderer.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mingling_macros') diff --git a/mingling_macros/src/renderer.rs b/mingling_macros/src/renderer.rs index 89b2188..362a4a4 100644 --- a/mingling_macros/src/renderer.rs +++ b/mingling_macros/src/renderer.rs @@ -131,11 +131,14 @@ pub fn renderer_attr(item: TokenStream) -> TokenStream { // Keep the original function for internal use (without r parameter) #(#fn_attrs)* - #vis fn #fn_name(#prev_param: #previous_type) { + #vis fn #fn_name(#prev_param: impl Into<#previous_type>) -> ::mingling::RenderResult { + let #prev_param = #prev_param.into(); let mut dummy_r = ::mingling::RenderResult::default(); - let r = &mut dummy_r; - #fn_body - println!("{}", r.trim()); + { + let r = &mut dummy_r; + #fn_body + } + dummy_r } }; -- cgit