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
|
|
@ -317,8 +317,8 @@ impl From<Presence> for Element {
|
|||
fn from(presence: Presence) -> Element {
|
||||
Element::builder("presence")
|
||||
.ns(ns::JABBER_CLIENT)
|
||||
.attr("from", presence.from.and_then(|value| Some(String::from(value))))
|
||||
.attr("to", presence.to.and_then(|value| Some(String::from(value))))
|
||||
.attr("from", presence.from.map(String::from))
|
||||
.attr("to", presence.to.map(String::from))
|
||||
.attr("id", presence.id)
|
||||
.attr("type", presence.type_)
|
||||
.append(presence.show)
|
||||
|
|
|
|||
Loading…
Reference in a new issue