ecaps2, jingle_s5b: Replace drain() with into_iter().

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-26 00:04:20 +01:00
parent 7511ca46c5
commit 4b3ced042e
2 changed files with 5 additions and 5 deletions

View file

@ -49,10 +49,10 @@ impl TryFrom<Element> for ECaps2 {
} }
impl From<ECaps2> for Element { impl From<ECaps2> for Element {
fn from(mut ecaps2: ECaps2) -> Element { fn from(ecaps2: ECaps2) -> Element {
Element::builder("c") Element::builder("c")
.ns(ns::ECAPS2) .ns(ns::ECAPS2)
.append(ecaps2.hashes.drain(..) .append(ecaps2.hashes.into_iter()
.map(Element::from) .map(Element::from)
.collect::<Vec<_>>()) .collect::<Vec<_>>())
.build() .build()

View file

@ -145,8 +145,8 @@ impl From<Transport> for Element {
.attr("dstaddr", transport.dstaddr) .attr("dstaddr", transport.dstaddr)
.attr("mode", transport.mode) .attr("mode", transport.mode)
.append(match transport.payload { .append(match transport.payload {
TransportPayload::Candidates(mut candidates) => { TransportPayload::Candidates(candidates) => {
candidates.drain(..) candidates.into_iter()
.map(Element::from) .map(Element::from)
.collect::<Vec<_>>() .collect::<Vec<_>>()
}, },
@ -161,7 +161,7 @@ impl From<Transport> for Element {
.ns(ns::JINGLE_S5B) .ns(ns::JINGLE_S5B)
.build()) .build())
}, },
TransportPayload::CandidateUsed(ref cid) => { TransportPayload::CandidateUsed(cid) => {
vec!(Element::builder("candidate-used") vec!(Element::builder("candidate-used")
.ns(ns::JINGLE_S5B) .ns(ns::JINGLE_S5B)
.attr("cid", cid) .attr("cid", cid)