diff --git a/databroker/src/broker.rs b/databroker/src/broker.rs index 77df1a2e..a5185598 100644 --- a/databroker/src/broker.rs +++ b/databroker/src/broker.rs @@ -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), } + } }); } } @@ -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 {}), @@ -786,8 +785,7 @@ impl ChangeSubscription { } notifications }; - match &self.sender.send(notifications).await - { + match &self.sender.send(notifications).await { Ok(()) => Ok(()), Err(_) => Err(NotificationError {}), }