From b6cacb98db9148013fbabc124a2d8e296232b2e0 Mon Sep 17 00:00:00 2001 From: huntc Date: Sun, 17 Oct 2021 06:26:06 +1100 Subject: [PATCH] Compact expression --- embassy-nrf/src/saadc.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index 11ed1f95..3acfa50d 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs @@ -271,20 +271,16 @@ impl<'d, const N: usize> Saadc<'d, N> { // Establish mode and sample rate match mode { Mode::Timers(sample_rate) => { - r.samplerate.write(|w| { - unsafe { - w.cc().bits(sample_rate); - w.mode().timers(); - } + r.samplerate.write(|w| unsafe { + w.cc().bits(sample_rate); + w.mode().timers(); w }); r.tasks_sample.write(|w| unsafe { w.bits(1) }); // Need to kick-start the internal timer } - Mode::Task => r.samplerate.write(|w| { - unsafe { - w.cc().bits(0); - w.mode().task(); - } + Mode::Task => r.samplerate.write(|w| unsafe { + w.cc().bits(0); + w.mode().task(); w }), }