From 617a976e96282a103a30667be402da27dc4bbbb3 Mon Sep 17 00:00:00 2001 From: huntc Date: Mon, 11 Oct 2021 08:54:24 +1100 Subject: [PATCH] No need for unwrap --- embassy-nrf/src/saadc.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index d7ccd2fc..d8ed5765 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs @@ -1,4 +1,3 @@ -use core::convert::TryInto; use core::marker::PhantomData; use core::sync::atomic::{compiler_fence, Ordering}; use core::task::Poll; @@ -189,7 +188,7 @@ impl<'d, const N: usize> OneShot<'d, N> { .write(|w| unsafe { w.ptr().bits(buf.as_mut_ptr() as u32) }); r.result .maxcnt - .write(|w| unsafe { w.maxcnt().bits(N.try_into().unwrap()) }); + .write(|w| unsafe { w.maxcnt().bits(N as _) }); // Reset and enable the end event r.events_end.reset();