@@ -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 {
@@ -91,7 +91,7 @@ impl TryFrom<Element> for Description {
if !elem.is("description", ns::JINGLE_FT) {
return Err(Error::ParseError("This is not a JingleFT description element."));
}
- if elem.children().collect::<Vec<_>>().len() != 1 {
+ if elem.children().count() != 1 {
return Err(Error::ParseError("JingleFT description element must have exactly one child."));
}