From e52817e5cda7540f0d49e9ca173bb14051858006 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 18 May 2017 23:14:07 +0100 Subject: [PATCH] message: Avoid identical match branches. --- src/message.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/message.rs b/src/message.rs index f76824ed..a900502b 100644 --- a/src/message.rs +++ b/src/message.rs @@ -46,15 +46,15 @@ impl<'a> TryFrom<&'a Element> for MessagePayload { ("error", ns::JABBER_CLIENT) => MessagePayload::StanzaError(StanzaError::try_from(elem)?), // XEP-0085 - ("active", ns::CHATSTATES) => MessagePayload::ChatState(ChatState::try_from(elem)?), - ("inactive", ns::CHATSTATES) => MessagePayload::ChatState(ChatState::try_from(elem)?), - ("composing", ns::CHATSTATES) => MessagePayload::ChatState(ChatState::try_from(elem)?), - ("paused", ns::CHATSTATES) => MessagePayload::ChatState(ChatState::try_from(elem)?), - ("gone", ns::CHATSTATES) => MessagePayload::ChatState(ChatState::try_from(elem)?), + ("active", ns::CHATSTATES) + | ("inactive", ns::CHATSTATES) + | ("composing", ns::CHATSTATES) + | ("paused", ns::CHATSTATES) + | ("gone", ns::CHATSTATES) => MessagePayload::ChatState(ChatState::try_from(elem)?), // XEP-0184 - ("request", ns::RECEIPTS) => MessagePayload::Receipt(Receipt::try_from(elem)?), - ("received", ns::RECEIPTS) => MessagePayload::Receipt(Receipt::try_from(elem)?), + ("request", ns::RECEIPTS) + | ("received", ns::RECEIPTS) => MessagePayload::Receipt(Receipt::try_from(elem)?), // XEP-0203 ("delay", ns::DELAY) => MessagePayload::Delay(Delay::try_from(elem)?),