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

@ -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."));
}