Use check_self!() where it makes sense.
This commit is contained in:
parent
e0438f9b88
commit
6bb466eea2
12 changed files with 62 additions and 95 deletions
|
|
@ -207,9 +207,7 @@ impl TryFrom<Element> for Iq {
|
|||
type Err = Error;
|
||||
|
||||
fn try_from(root: Element) -> Result<Iq, Error> {
|
||||
if !root.is("iq", ns::DEFAULT_NS) {
|
||||
return Err(Error::ParseError("This is not an iq element."));
|
||||
}
|
||||
check_self!(root, "iq", ns::DEFAULT_NS);
|
||||
let from = get_attr!(root, "from", optional);
|
||||
let to = get_attr!(root, "to", optional);
|
||||
let id = get_attr!(root, "id", optional);
|
||||
|
|
|
|||
Loading…
Reference in a new issue