Replace .and_then() with .map() wherever it makes sense.
This commit is contained in:
parent
7612c53f9a
commit
21cee25b27
6 changed files with 16 additions and 16 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue