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

@ -49,7 +49,7 @@ impl From<Delay> for Element {
fn from(delay: Delay) -> Element {
Element::builder("delay")
.ns(ns::DELAY)
.attr("from", delay.from.and_then(|value| Some(String::from(value))))
.attr("from", delay.from.map(String::from))
.attr("stamp", delay.stamp.to_rfc3339())
.append(delay.data)
.build()