mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 13:55:23 +01:00
Use untagged_option crate
This commit is contained in:
parent
c8bdb7329f
commit
57ed0963ff
3 changed files with 8 additions and 7 deletions
|
|
@ -233,7 +233,7 @@ fn init(app: &App, main: &mut Vec<Tokens>, root: &mut Vec<Tokens>) {
|
|||
});
|
||||
|
||||
late_resources.push(quote! {
|
||||
#_name = #krate::LateResource { init: _late_resources.#name };
|
||||
#_name = #krate::UntaggedOption { some: _late_resources.#name };
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -344,7 +344,7 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
|
|||
},
|
||||
None => quote! {
|
||||
// Resource initialized in `init`
|
||||
static mut #_name: #krate::LateResource<#ty> = #krate::LateResource { uninit: () };
|
||||
static mut #_name: #krate::UntaggedOption<#ty> = #krate::UntaggedOption { none: () };
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -587,7 +587,7 @@ fn tasks(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
|
|||
}
|
||||
} else {
|
||||
quote! {
|
||||
#name: ::#krate::Static::ref_mut(&mut ::#_name.init),
|
||||
#name: ::#krate::Static::ref_mut(::#_name.as_mut()),
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue