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

@ -170,7 +170,7 @@ impl<'a> TryFrom<&'a Element> for Presence {
return Err(Error::ParseError("Unknown child in status element."));
}
let lang = elem.attr("xml:lang").unwrap_or("").to_owned();
if let Some(_) = statuses.insert(lang, elem.text()) {
if statuses.insert(lang, elem.text()).is_some() {
return Err(Error::ParseError("Status element present twice for the same xml:lang."));
}
} else if elem.is("priority", ns::JABBER_CLIENT) {