mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-24 02:49:34 +01:00
Cleanup of resource initialization, no need to dereference
This commit is contained in:
parent
1e2ab78a3f
commit
d3d66c97ae
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> {
|
|||
// Resource is a RacyCell<MaybeUninit<T>>
|
||||
// - `get_mut` to obtain a raw pointer to `MaybeUninit<T>`
|
||||
// - `write` the defined value for the late resource T
|
||||
(&mut *#mangled_name.get_mut()).as_mut_ptr().write(shared_resources.#name);
|
||||
#mangled_name.get_mut().write(core::mem::MaybeUninit::new(shared_resources.#name));
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> {
|
|||
// Resource is a RacyCell<MaybeUninit<T>>
|
||||
// - `get_mut` to obtain a raw pointer to `MaybeUninit<T>`
|
||||
// - `write` the defined value for the late resource T
|
||||
(&mut *#mangled_name.get_mut()).as_mut_ptr().write(local_resources.#name);
|
||||
#mangled_name.get_mut().write(core::mem::MaybeUninit::new(local_resources.#name));
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue