diff --git a/src/ecaps2.rs b/src/ecaps2.rs index 593acec0..8166e5b0 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -49,10 +49,10 @@ impl TryFrom for ECaps2 { } impl From for Element { - fn from(mut ecaps2: ECaps2) -> Element { + fn from(ecaps2: ECaps2) -> Element { Element::builder("c") .ns(ns::ECAPS2) - .append(ecaps2.hashes.drain(..) + .append(ecaps2.hashes.into_iter() .map(Element::from) .collect::>()) .build() diff --git a/src/jingle_s5b.rs b/src/jingle_s5b.rs index 7ef1e502..d454a3d9 100644 --- a/src/jingle_s5b.rs +++ b/src/jingle_s5b.rs @@ -145,8 +145,8 @@ impl From for Element { .attr("dstaddr", transport.dstaddr) .attr("mode", transport.mode) .append(match transport.payload { - TransportPayload::Candidates(mut candidates) => { - candidates.drain(..) + TransportPayload::Candidates(candidates) => { + candidates.into_iter() .map(Element::from) .collect::>() }, @@ -161,7 +161,7 @@ impl From for Element { .ns(ns::JINGLE_S5B) .build()) }, - TransportPayload::CandidateUsed(ref cid) => { + TransportPayload::CandidateUsed(cid) => { vec!(Element::builder("candidate-used") .ns(ns::JINGLE_S5B) .attr("cid", cid)