Skip to content

Commit 497eed0

Browse files
committed
Apply some clippy suggestions
1 parent 936107a commit 497eed0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/adc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ where
348348
// NOTE: Software is allowed to set ADSTP only when ADSTART=1 and ADDIS=0
349349
// (ADC is enabled and eventually converting a regular conversion and there is no
350350
// pending request to disable the ADC)
351-
if self.adc.cr.read().addis().bit() == false
351+
if !self.adc.cr.read().addis().bit()
352352
&& (self.adc.cr.read().adstart().bit() || self.adc.cr.read().jadstart().bit())
353353
{
354354
self.adc.cr.modify(|_, w| w.adstp().stop());
@@ -385,7 +385,7 @@ where
385385
}
386386

387387
fn wait_adc_clk_cycles(&self, cycles: u32, clocks: Clocks) {
388-
let frequency = ADC::clock(&clocks).unwrap_or(clocks.sysclk());
388+
let frequency = ADC::clock(&clocks).unwrap_or_else(|| clocks.sysclk());
389389
let cpu_cycles = cycles * clocks.sysclk().0 / frequency.0;
390390
asm::delay(cpu_cycles);
391391
}
@@ -417,7 +417,7 @@ where
417417
self.adc.cr.modify(|_, w| w.adstart().start());
418418
while self.adc.isr.read().eos().is_not_complete() {}
419419
self.adc.isr.modify(|_, w| w.eos().clear());
420-
return self.adc.dr.read().rdata().bits();
420+
self.adc.dr.read().rdata().bits()
421421
}
422422

423423
/// This should only be invoked with the defined channels for the particular
@@ -478,7 +478,7 @@ where
478478
fn read(&mut self, _pin: &mut Pin) -> nb::Result<Word, Self::Error> {
479479
// TODO: Convert back to previous mode after use.
480480
let res = self.convert_one(Pin::channel());
481-
return Ok(res.into());
481+
Ok(res.into())
482482
}
483483
}
484484

0 commit comments

Comments
 (0)