Move initialisation inside of future
This commit is contained in:
parent
8a4ab29819
commit
ae0219de6f
@ -97,10 +97,10 @@ impl<'d> traits::rng::Rng for Rng<'d> {
|
|||||||
type RngFuture<'a> where 'd: 'a = impl Future<Output = Result<(), Self::Error>> + 'a;
|
type RngFuture<'a> where 'd: 'a = impl Future<Output = Result<(), Self::Error>> + 'a;
|
||||||
|
|
||||||
fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> {
|
fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> {
|
||||||
self.enable_irq();
|
|
||||||
self.start();
|
|
||||||
|
|
||||||
async move {
|
async move {
|
||||||
|
self.enable_irq();
|
||||||
|
self.start();
|
||||||
|
|
||||||
let on_drop = OnDrop::new(|| {
|
let on_drop = OnDrop::new(|| {
|
||||||
self.stop();
|
self.stop();
|
||||||
self.disable_irq();
|
self.disable_irq();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user