increase command flexibility
This commit is contained in:
@@ -107,9 +107,7 @@ impl PinData {
|
||||
// Do this twice to check both the current and the current next
|
||||
// If the current is currently invalid, we'd upgrade the next to current
|
||||
for _ in 0..2 {
|
||||
let is_current_valid = self
|
||||
.valid_until
|
||||
.is_some_and(|current| current >= now);
|
||||
let is_current_valid = self.valid_until.is_some_and(|current| current >= now);
|
||||
if is_current_valid {
|
||||
self.value = self.state;
|
||||
return;
|
||||
@@ -135,10 +133,10 @@ impl PinData {
|
||||
);
|
||||
let can_replace_current = self
|
||||
.valid_until
|
||||
.is_none_or(|current| current <= valid_until);
|
||||
let can_replace_next = self
|
||||
.next_validity
|
||||
.is_none_or(|next| next <= valid_until);
|
||||
.is_none_or(|current| current <= valid_until)
|
||||
|| self.priority == priority;
|
||||
let can_replace_next = self.next_validity.is_none_or(|next| next <= valid_until)
|
||||
|| self.next_priority == priority;
|
||||
|
||||
if priority >= self.priority {
|
||||
// This is now the highest priority thing (or most recent of equal priority)
|
||||
|
||||
Reference in New Issue
Block a user