Move initialisation inside of future
This commit is contained in:
parent
8a4ab29819
commit
ae0219de6f
1 changed files with 3 additions and 3 deletions
|
@ -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> {
|
||||||
|
async move {
|
||||||
self.enable_irq();
|
self.enable_irq();
|
||||||
self.start();
|
self.start();
|
||||||
|
|
||||||
async move {
|
|
||||||
let on_drop = OnDrop::new(|| {
|
let on_drop = OnDrop::new(|| {
|
||||||
self.stop();
|
self.stop();
|
||||||
self.disable_irq();
|
self.disable_irq();
|
||||||
|
|
Loading…
Reference in a new issue