diff --git a/src/plugins/roster.rs b/src/plugins/roster.rs index 487a90f..f287c46 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));