diff --git a/src/ecaps2.rs b/src/ecaps2.rs index 54228c8d..be80ffd5 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -52,8 +52,8 @@ impl From for Element { Element::builder("c") .ns(ns::ECAPS2) .append(ecaps2.hashes.drain(..) - .map(|hash| hash.into()) - .collect::>()) + .map(Element::from) + .collect::>()) .build() } } diff --git a/src/forwarding.rs b/src/forwarding.rs index 3afaabdf..86474dd1 100644 --- a/src/forwarding.rs +++ b/src/forwarding.rs @@ -52,8 +52,8 @@ impl From for Element { fn from(forwarded: Forwarded) -> Element { Element::builder("forwarded") .ns(ns::FORWARD) - .append(match forwarded.delay { Some(delay) => { let elem: Element = delay.into(); Some(elem) }, None => None }) - .append(match forwarded.stanza { Some(stanza) => { let elem: Element = stanza.into(); Some(elem) }, None => None }) + .append(forwarded.delay.map(Element::from)) + .append(forwarded.stanza.map(Element::from)) .build() } } diff --git a/src/jingle_s5b.rs b/src/jingle_s5b.rs index 26852904..7ef1e502 100644 --- a/src/jingle_s5b.rs +++ b/src/jingle_s5b.rs @@ -147,8 +147,8 @@ impl From for Element { .append(match transport.payload { TransportPayload::Candidates(mut candidates) => { candidates.drain(..) - .map(|candidate| candidate.into()) - .collect::>() + .map(Element::from) + .collect::>() }, TransportPayload::Activated(cid) => { vec!(Element::builder("activated") diff --git a/src/mam.rs b/src/mam.rs index bbc08a6d..b52e8041 100644 --- a/src/mam.rs +++ b/src/mam.rs @@ -167,8 +167,8 @@ impl From for Element { .ns(ns::MAM) .attr("queryid", query.queryid) .attr("node", query.node) - //.append(query.form.map(|form| -> Element { form.into() })) - .append(query.set.map(|set| -> Element { set.into() })) + //.append(query.form.map(Element::from)) + .append(query.set.map(Element::from)) .build() } }