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

@ -22,9 +22,7 @@ impl TryFrom<Element> for Muc {
type Err = Error;
fn try_from(elem: Element) -> Result<Muc, Error> {
if !elem.is("x", ns::MUC) {
return Err(Error::ParseError("This is not an x element."));
}
check_self!(elem, "x", ns::MUC);
check_no_attributes!(elem, "x");
let mut password = None;