diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-05-02 22:57:18 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-02 22:57:18 +0800 |
| commit | 12e7b65883a22030039806c41e704c27731e8dd9 (patch) | |
| tree | 5461f7cc5a7c69fcf2d4752833eb38b72e21fe4a /mingling_macros | |
| parent | 81be96847833bd443ddb157cedb7939d8ffcc150 (diff) | |
Add Display derive and testing utilities for Next enum
Diffstat (limited to 'mingling_macros')
| -rw-r--r-- | mingling_macros/src/renderer.rs | 11 |
1 files changed, 7 insertions, 4 deletions
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 } }; |
