iq, jingle_ft: Simplify item counting with Iterator::count().

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-20 23:08:23 +01:00
commit f6f6faeb77
3 changed files with 3 additions and 3 deletions

View file

@ -222,7 +222,7 @@ impl TryFrom<Element> for Iq {
return Err(Error::ParseError("Wrong number of children in iq element."));
}
error_payload = Some(StanzaError::try_from(elem.clone())?);
} else if root.children().collect::<Vec<_>>().len() != 2 {
} else if root.children().count() != 2 {
return Err(Error::ParseError("Wrong number of children in iq element."));
}
} else {