From 5e5086e2efb11c4999626753b972678c3a3bb464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 28 Dec 2017 04:16:53 +0100 Subject: [PATCH] plugins/roster: Subscription is now an enum --- src/plugins/roster.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/roster.rs b/src/plugins/roster.rs index 487a90ff..f287c46d 100644 --- a/src/plugins/roster.rs +++ b/src/plugins/roster.rs @@ -77,7 +77,7 @@ impl RosterPlugin { // TODO: use a better error type. pub fn send_roster_set(&self, to: Option, item: Item) -> Result<(), String> { - if item.subscription.is_some() && item.subscription != Some(Subscription::Remove) { + if item.subscription != Subscription::Remove { return Err(String::from("Subscription must be either nothing or Remove.")); } let iq = Iq { @@ -117,10 +117,10 @@ impl RosterPlugin { let mut jids = self.jids.lock().unwrap(); let previous = jids.insert(item.jid.clone(), item.clone()); if previous.is_none() { - assert!(item.subscription != Some(Subscription::Remove)); + assert!(item.subscription != Subscription::Remove); self.proxy.dispatch(RosterPush::Added(item)); } else { - if item.subscription == Some(Subscription::Remove) { + if item.subscription == Subscription::Remove { self.proxy.dispatch(RosterPush::Removed(item)); } else { self.proxy.dispatch(RosterPush::Modified(item));