aboutsummaryrefslogtreecommitdiff
path: root/macros/src
diff options
context:
space:
mode:
Diffstat (limited to 'macros/src')
-rw-r--r--macros/src/trans.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/macros/src/trans.rs b/macros/src/trans.rs
index 45841e73..96ff770b 100644
--- a/macros/src/trans.rs
+++ b/macros/src/trans.rs
@@ -74,8 +74,14 @@ fn idle(
});
let _name = Ident::new(format!("_{}", name.as_ref()));
- rexprs.push(quote! {
- #name: &mut #super_::#_name,
+ rexprs.push(if resource.expr.is_some() {
+ quote! {
+ #name: &mut #super_::#_name,
+ }
+ } else {
+ quote! {
+ #name: #super_::#_name.as_mut(),
+ }
});
} else {
rfields.push(quote! {