Replace .and_then() with .map() wherever it makes sense.

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-21 01:19:34 +01:00
commit 21cee25b27
6 changed files with 16 additions and 16 deletions

View file

@ -177,7 +177,7 @@ impl From<StanzaError> for Element {
let mut root = Element::builder("error")
.ns(ns::JABBER_CLIENT)
.attr("type", err.type_)
.attr("by", err.by.and_then(|by| Some(String::from(by))))
.attr("by", err.by.map(String::from))
.append(err.defined_condition)
.build();
for (lang, text) in err.texts {