iq: Remove unused variable causing a warning.

This commit is contained in:
Emmanuel Gil Peyrot 2017-05-01 01:50:38 +01:00
parent 7b6d444f03
commit c0b7c9da88

View file

@ -268,19 +268,16 @@ mod tests {
</error> </error>
</iq>".parse().unwrap(); </iq>".parse().unwrap();
let iq = iq::parse_iq(&elem).unwrap(); let iq = iq::parse_iq(&elem).unwrap();
let error: Element = "<error xmlns='jabber:client' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>".parse().unwrap();
assert_eq!(iq.from, None); assert_eq!(iq.from, None);
assert_eq!(iq.to, None); assert_eq!(iq.to, None);
assert_eq!(iq.id, None); assert_eq!(iq.id, None);
match iq.payload { match iq.payload {
iq::IqType::Error(element) => { iq::IqType::Error(error) => {
assert_eq!(element.type_, stanza_error::ErrorType::Cancel); assert_eq!(error.type_, stanza_error::ErrorType::Cancel);
assert_eq!(element.by, None); assert_eq!(error.by, None);
assert_eq!(element.defined_condition, stanza_error::DefinedCondition::ServiceUnavailable); assert_eq!(error.defined_condition, stanza_error::DefinedCondition::ServiceUnavailable);
assert_eq!(element.texts.len(), 0); assert_eq!(error.texts.len(), 0);
assert_eq!(element.other, None); assert_eq!(error.other, None);
}, },
_ => panic!(), _ => panic!(),
} }