aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/renderer.rs
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-22 09:56:04 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-22 09:56:04 +0800
commite843405ecfee06ea158fb0070d4c70c2f228c82c (patch)
treeb3fb888dd00797a9880d76b704fd8564a27b7799 /mingling_macros/src/renderer.rs
parent7adbe2715285d7baedfb91f5e81f5ea64f7d1a5a (diff)
Refactor renderer to use injected resources directly
Diffstat (limited to 'mingling_macros/src/renderer.rs')
-rw-r--r--mingling_macros/src/renderer.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/mingling_macros/src/renderer.rs b/mingling_macros/src/renderer.rs
index db04c19..7f85a60 100644
--- a/mingling_macros/src/renderer.rs
+++ b/mingling_macros/src/renderer.rs
@@ -115,16 +115,14 @@ pub fn renderer_attr(attr: TokenStream, item: TokenStream) -> TokenStream {
quote! { #(#fn_body_stmts)* }
};
- // Build the original function with resource injection (no `.into()` — signature is exactly as user wrote)
+ // Build the original function with resource injection - use the resource bindings directly
+ // from the function parameters rather than re-fetching from context.
let original_fn_body = if has_resources {
- let wrapped_body =
- wrap_body_with_mut_resources(&fn_body_stmts, &mut_resources, program_type);
quote! {
let mut dummy_r = ::mingling::RenderResult::default();
{
let __renderer_inner_result = &mut dummy_r;
- #(#immut_resource_stmts)*
- #wrapped_body
+ #(#fn_body_stmts)*
}
#result_return
}