refactor: simplify tracking of subscriptions

This commit is contained in:
Greg Heartsfield
2022-12-17 20:46:58 -06:00
parent 9be04120c7
commit 0b9778d6ca
2 changed files with 7 additions and 10 deletions
+5
View File
@@ -46,6 +46,11 @@ impl ClientConn {
&self.subscriptions
}
/// Check if the given subscription already exists
pub fn has_subscription(&self, sub: &Subscription) -> bool {
self.subscriptions.values().any(|x| x == sub)
}
/// Get a short prefix of the client's unique identifier, suitable
/// for logging.
#[must_use]