Skip to content

Commit 1b48fe2

Browse files
lzrdmkeeter
andcommitted
Update drv/lpc55-update-server/src/main.rs
Co-authored-by: Matt Keeter <[email protected]>
1 parent daad273 commit 1b48fe2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drv/lpc55-update-server/src/main.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -524,17 +524,13 @@ impl idl::InOrderUpdateImpl for ServerImpl<'_> {
524524
self.boot_preferences()?;
525525

526526
// The transient preference must not select the update target.
527-
if let Some(pref) = transient {
528-
if slot == pref {
529-
return Err(UpdateError::InvalidPreferredSlotId.into());
530-
}
527+
if transient == Some(slot) {
528+
return Err(UpdateError::InvalidPreferredSlotId.into());
531529
}
532530
// If there is a pending persistent preference, it must
533531
// not select the update target.
534-
if let Some(pref) = pending_persistent {
535-
if slot == pref {
536-
return Err(UpdateError::InvalidPreferredSlotId.into());
537-
}
532+
if pending_persistent == Some(slot) {
533+
return Err(UpdateError::InvalidPreferredSlotId.into());
538534
} else if slot == persistent {
539535
// If there is no pending persistent preference, then the
540536
// persistent preference must select the currently active image.

0 commit comments

Comments
 (0)