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

@ -20,9 +20,7 @@ impl TryFrom<Element> for Version {
type Err = Error;
fn try_from(elem: Element) -> Result<Version, Error> {
if !elem.is("query", ns::VERSION) {
return Err(Error::ParseError("This is not a version element."));
}
check_self!(elem, "query", ns::VERSION, "version");
check_no_attributes!(elem, "version");
let mut name = None;
let mut version = None;