Skip to content

Commit 79e224a

Browse files
committed
clippy fixes
1 parent b2072ff commit 79e224a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

va108xx/flashloader/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ mod app {
269269

270270
fn handle_valid_pus_tc(cx: &mut pus_tc_handler::Context) {
271271
let pus_tc = PusTcReader::new(cx.local.tc_buf);
272-
if pus_tc.is_err() {
273-
defmt::warn!("PUS TC error: {}", pus_tc.unwrap_err());
272+
if let Err(e) = pus_tc {
273+
defmt::warn!("PUS TC error: {}", e);
274274
return;
275275
}
276276
let pus_tc = pus_tc.unwrap();

va416xx/bootloader/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ pub struct OptWdt(Option<Wdt>);
8686

8787
impl WdtInterface for OptWdt {
8888
fn feed(&self) {
89-
if self.0.is_some() {
90-
self.0.as_ref().unwrap().feed();
89+
if let Some(wdt) = &self.0 {
90+
wdt.feed();
9191
}
9292
}
9393
}

va416xx/flashloader/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ pub struct OptWdt(Option<Wdt>);
4646

4747
impl WdtInterface for OptWdt {
4848
fn feed(&self) {
49-
if self.0.is_some() {
50-
self.0.as_ref().unwrap().feed();
49+
if let Some(wdt) = &self.0 {
50+
wdt.feed();
5151
}
5252
}
5353
}
@@ -344,8 +344,8 @@ mod app {
344344

345345
fn handle_valid_pus_tc(cx: &mut pus_tc_handler::Context) {
346346
let pus_tc = PusTcReader::new(cx.local.tc_buf);
347-
if pus_tc.is_err() {
348-
defmt::warn!("PUS TC error: {}", pus_tc.unwrap_err());
347+
if let Err(e) = pus_tc {
348+
defmt::warn!("PUS TC error: {}", e);
349349
return;
350350
}
351351
let pus_tc = pus_tc.unwrap();

0 commit comments

Comments
 (0)