diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-01-06 10:15:46 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-06 10:15:46 +0000 |
| commit | 82e5edb94064b51af433b4c3e89a7cf4b6eaa826 (patch) | |
| tree | b7e20e5b1fb1f764d3b837e66858034390cefff5 /examples | |
| parent | 23b9ede3952c2f26c54c77b8df02cd2f8e8f9aad (diff) | |
| parent | d5d8897c847052680b25ea1511c4cac39a29a00d (diff) | |
Merge #567
567: Remove unsafe from new on RND r=Dirbaio a=huntc
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. Therefore, just confining this PR to what I'm currently exposed to.
Co-authored-by: huntc <[email protected]>
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]; |
