diff options
| author | huntc <[email protected]> | 2022-01-06 09:59:28 +1100 |
|---|---|---|
| committer | huntc <[email protected]> | 2022-01-06 09:59:28 +1100 |
| commit | d5d8897c847052680b25ea1511c4cac39a29a00d (patch) | |
| tree | 3fdc5d70f1bcbded81f43f8a7e023996b6a23991 /examples | |
| parent | da0c25227f188ebde4ae275f572722d27e578a67 (diff) | |
Remove unsafe from new on RND
Unsafe is not required here given that all futures are required to live longer than their global peripheral instances. There are other occurrences of unsafe being used on new that should be removed. I started to do that but then went down a bit of a rabbit hole.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/src/bin/rng.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/nrf/src/bin/rng.rs b/examples/nrf/src/bin/rng.rs index d12684e35..2f1a26993 100644 --- a/examples/nrf/src/bin/rng.rs +++ b/examples/nrf/src/bin/rng.rs | |||
| @@ -15,7 +15,7 @@ use rand::Rng as _; | |||
| 15 | 15 | ||
| 16 | #[embassy::main] | 16 | #[embassy::main] |
| 17 | async fn main(_spawner: Spawner, p: Peripherals) { | 17 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 18 | let mut rng = unsafe { Rng::new(p.RNG, interrupt::take!(RNG)) }; | 18 | let mut rng = Rng::new(p.RNG, interrupt::take!(RNG)); |
| 19 | 19 | ||
| 20 | // Async API | 20 | // Async API |
| 21 | let mut bytes = [0; 4]; | 21 | let mut bytes = [0; 4]; |
