diff options
author | 2017-10-02 14:49:40 +0200 | |
---|---|---|
committer | 2017-10-02 14:49:40 +0200 | |
commit | 2415a640af49666799bb4cd09a40f16853bdd687 (patch) | |
tree | c8757ae7905dd2fa3063a6c085b9152d19121422 /macros/src/trans.rs | |
parent | a190da3e3ff63a25a33ac30fc99421ab0decce57 (diff) | |
download | rtic-2415a640af49666799bb4cd09a40f16853bdd687.tar.gz rtic-2415a640af49666799bb4cd09a40f16853bdd687.tar.zst rtic-2415a640af49666799bb4cd09a40f16853bdd687.zip |
fix `idle::Resources::new`
it assumed that all resources were "early" resources
Diffstat (limited to '')
-rw-r--r-- | macros/src/trans.rs | 10 |
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! { |