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

@ -248,9 +248,7 @@ impl TryFrom<Element> for Presence {
type Err = Error;
fn try_from(root: Element) -> Result<Presence, Error> {
if !root.is("presence", ns::DEFAULT_NS) {
return Err(Error::ParseError("This is not a presence element."));
}
check_self!(root, "presence", ns::DEFAULT_NS);
let mut show = None;
let mut priority = None;
let mut presence = Presence {