From 4b3ced042e54c8d3e4491b664e7af839ae413c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 26 Jul 2017 00:04:20 +0100 Subject: [PATCH] ecaps2, jingle_s5b: Replace drain() with into_iter(). --- src/ecaps2.rs | 4 ++-- src/jingle_s5b.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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)