iq: Clippify

This commit is contained in:
Maxime “pep” Buquet 2017-04-24 19:20:35 +01:00
parent c462d230f1
commit 1b4c0c4589

View file

@ -144,14 +144,14 @@ pub fn serialise(iq: &Iq) -> Element {
.attr("type", iq.payload.clone()) .attr("type", iq.payload.clone())
.build(); .build();
let elem = match iq.payload.clone() { let elem = match iq.payload.clone() {
IqType::Get(IqPayloadType::XML(elem)) => elem, IqType::Get(IqPayloadType::XML(elem))
IqType::Get(IqPayloadType::Parsed(payload)) => serialise_payload(&payload), | IqType::Set(IqPayloadType::XML(elem))
IqType::Set(IqPayloadType::XML(elem)) => elem, | IqType::Result(Some(IqPayloadType::XML(elem)))
IqType::Set(IqPayloadType::Parsed(payload)) => serialise_payload(&payload), | IqType::Error(IqPayloadType::XML(elem)) => elem,
IqType::Get(IqPayloadType::Parsed(payload))
| IqType::Set(IqPayloadType::Parsed(payload))
| IqType::Result(Some(IqPayloadType::Parsed(payload))) => serialise_payload(&payload),
IqType::Result(None) => return stanza, IqType::Result(None) => return stanza,
IqType::Result(Some(IqPayloadType::XML(elem))) => elem,
IqType::Result(Some(IqPayloadType::Parsed(payload))) => serialise_payload(&payload),
IqType::Error(IqPayloadType::XML(elem)) => elem,
_ => panic!(), _ => panic!(),
}; };
stanza.append_child(elem); stanza.append_child(elem);