Use check_self!() where it makes sense.

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-12 18:31:11 +02:00
commit 6bb466eea2
12 changed files with 62 additions and 95 deletions

View file

@ -26,9 +26,7 @@ impl TryFrom<Element> for Forwarded {
type Err = Error;
fn try_from(elem: Element) -> Result<Forwarded, Error> {
if !elem.is("forwarded", ns::FORWARD) {
return Err(Error::ParseError("This is not a forwarded element."));
}
check_self!(elem, "forwarded", ns::FORWARD);
let mut delay = None;
let mut stanza = None;
for child in elem.children() {