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

@ -29,9 +29,7 @@ impl TryFrom<Element> for Query {
type Err = Error;
fn try_from(elem: Element) -> Result<Query, Error> {
if !elem.is("query", ns::REGISTER) {
return Err(Error::ParseError("This is not an ibr element."));
}
check_self!(elem, "query", ns::REGISTER, "IBR query");
let mut query = Query {
registered: false,
fields: HashMap::new(),