sim: Remove complexity from an if

Clippy suggests that having a closure in the condition of an if can be
confusing in regards to code formatting.  Move the conditional outside
of the if into a temp variable.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2021-03-10 05:24:33 -07:00 committed by David Brown
parent d36f6b1c16
commit 80f836d19d
1 changed files with 8 additions and 5 deletions

View File

@ -1564,11 +1564,14 @@ fn install_ptable(flash: &mut SimMultiFlash, areadesc: &AreaDesc) {
// aren't marked as the BootLoader partition, avoid adding the
// partition table. This makes it harder to view the image, but
// avoids messing up images already written.
if areadesc.iter_areas().any(|area| {
area.device_id == id &&
area.off == 0 &&
area.flash_id != FlashId::BootLoader
}) {
let skip_ptable = areadesc
.iter_areas()
.any(|area| {
area.device_id == id &&
area.off == 0 &&
area.flash_id != FlashId::BootLoader
});
if skip_ptable {
if log_enabled!(Info) {
let special: Vec<FlashId> = areadesc.iter_areas()
.filter(|area| area.device_id == id && area.off == 0)