Skip to content

Commit 4c26d82

Browse files
committed
clippy
1 parent 531a7ee commit 4c26d82

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/sai/i2s.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl<SAI: I2sInstance> Sai<SAI, I2S> {
455455
let _pins = pins.convert();
456456

457457
i2s_config_channel(
458-
&per_sai.rb.cha(),
458+
per_sai.rb.cha(),
459459
I2SMode::Master,
460460
&per_sai.interface.master,
461461
mclk_div,
@@ -464,7 +464,7 @@ impl<SAI: I2sInstance> Sai<SAI, I2S> {
464464

465465
if let Some(slave) = &per_sai.interface.slave {
466466
i2s_config_channel(
467-
&per_sai.rb.chb(),
467+
per_sai.rb.chb(),
468468
I2SMode::Slave,
469469
slave,
470470
0,
@@ -518,7 +518,7 @@ impl<SAI: I2sInstance> Sai<SAI, I2S> {
518518
let _pins = pins.convert();
519519

520520
i2s_config_channel(
521-
&per_sai.rb.chb(),
521+
per_sai.rb.chb(),
522522
I2SMode::Master,
523523
&per_sai.interface.master,
524524
mclk_div,
@@ -527,7 +527,7 @@ impl<SAI: I2sInstance> Sai<SAI, I2S> {
527527

528528
if let Some(slave) = &per_sai.interface.slave {
529529
i2s_config_channel(
530-
&per_sai.rb.cha(),
530+
per_sai.rb.cha(),
531531
I2SMode::Slave,
532532
slave,
533533
0,

src/sai/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,8 @@ where
210210
where
211211
F: FnOnce(&CH) -> T,
212212
{
213-
match self.slave_channel {
214-
Some(channel) => Some(func(&self.rb.ch[channel as usize])),
215-
None => None,
216-
}
213+
self.slave_channel
214+
.map(|channel| func(&self.rb.ch[channel as usize]))
217215
}
218216

219217
/// Start listening for `event` on a given `channel`

0 commit comments

Comments
 (0)