Skip to content

Commit 8608c53

Browse files
committed
sim: Clarify condition
Clippy suggests using an if instead of using a map on an option. Signed-off-by: David Brown <david.brown@linaro.org>
1 parent 4bbb93d commit 8608c53

File tree

1 file changed

+3
-1
lines changed
  • sim/mcuboot-sys/src

1 file changed

+3
-1
lines changed

sim/mcuboot-sys/src/c.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ pub fn boot_go(multiflash: &mut SimMultiFlash, areadesc: &AreaDesc,
3030
raw::invoke_boot_go(&mut sim_ctx as *mut _, &areadesc.get_c() as *const _) as i32
3131
};
3232
let asserts = sim_ctx.c_asserts;
33-
counter.map(|c| *c = sim_ctx.flash_counter);
33+
if let Some(c) = counter {
34+
*c = sim_ctx.flash_counter;
35+
}
3436
for &dev_id in multiflash.keys() {
3537
api::clear_flash(dev_id);
3638
}

0 commit comments

Comments
 (0)