Fix most clippy warnings.

This commit is contained in:
Emmanuel Gil Peyrot 2017-05-07 15:23:06 +01:00
commit 4ec92b16ac
5 changed files with 9 additions and 12 deletions

View file

@ -173,7 +173,7 @@ impl<'a> TryFrom<&'a Element> for StanzaError {
return Err(Error::ParseError("Unknown element in error text."));
}
let lang = child.attr("xml:lang").unwrap_or("").to_owned();
if let Some(_) = texts.insert(lang, child.text()) {
if texts.insert(lang, child.text()).is_some() {
return Err(Error::ParseError("Text element present twice for the same xml:lang."));
}
} else if child.ns() == Some(ns::XMPP_STANZAS) {