Skip to content

Commit

Permalink
fixup! Remove optional
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmittag committed Apr 17, 2024
1 parent b6733c9 commit 17ea444
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions databroker/src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,19 +661,19 @@ impl Subscriptions {
}
});
self.change_subscriptions.retain_mut(|sub| {
if sub.sender.is_closed() {
info!("Subscriber gone: removing subscription");
false
} else {
match &sub.permissions.expired() {
Ok(()) => true,
Err(PermissionError::Expired) => {
info!("Token expired: removing subscription");
false
}
Err(err) => panic!("Error: {:?}", err),
if sub.sender.is_closed() {
info!("Subscriber gone: removing subscription");
false
} else {
match &sub.permissions.expired() {
Ok(()) => true,
Err(PermissionError::Expired) => {
info!("Token expired: removing subscription");
false
}
Err(err) => panic!("Error: {:?}", err),
}
}
});
}
}
Expand Down Expand Up @@ -744,8 +744,7 @@ impl ChangeSubscription {
};
if notifications.updates.is_empty() {
Ok(())
}
else {
} else {
match &self.sender.send(notifications).await {
Ok(()) => Ok(()),
Err(_) => Err(NotificationError {}),
Expand Down Expand Up @@ -786,8 +785,7 @@ impl ChangeSubscription {
}
notifications
};
match &self.sender.send(notifications).await
{
match &self.sender.send(notifications).await {
Ok(()) => Ok(()),
Err(_) => Err(NotificationError {}),
}
Expand Down

0 comments on commit 17ea444

Please sign in to comment.