From 5df585ca40239282fb0c05d7ef0633e5784a4876 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 20 Jul 2017 23:09:22 +0100 Subject: [PATCH] data_forms, ibr, message, presence, roster: Always use into_iter. --- src/data_forms.rs | 2 +- src/ibr.rs | 4 ++-- src/message.rs | 4 ++-- src/presence.rs | 2 +- src/roster.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/data_forms.rs b/src/data_forms.rs index d4678c09..bccdca09 100644 --- a/src/data_forms.rs +++ b/src/data_forms.rs @@ -72,7 +72,7 @@ impl From for Element { .attr("label", field.label) .append(if field.required { Some(Element::builder("required").ns(ns::DATA_FORMS).build()) } else { None }) .append(field.options) - .append(field.values.iter().map(|value| { + .append(field.values.into_iter().map(|value| { Element::builder("value").ns(ns::DATA_FORMS).append(value).build() }).collect::>()) .append(field.media) diff --git a/src/ibr.rs b/src/ibr.rs index 37c54f7b..59dc15d8 100644 --- a/src/ibr.rs +++ b/src/ibr.rs @@ -69,8 +69,8 @@ impl From for Element { Element::builder("query") .ns(ns::REGISTER) .append(if query.registered { Some(Element::builder("registered").ns(ns::REGISTER)) } else { None }) - .append(query.fields.iter().map(|(name, value)| { - Element::builder(name.clone()).ns(ns::REGISTER).append(value.clone()) + .append(query.fields.into_iter().map(|(name, value)| { + Element::builder(name).ns(ns::REGISTER).append(value) }).collect::>()) .append(if query.remove { Some(Element::builder("remove").ns(ns::REGISTER)) } else { None }) .append(query.form) diff --git a/src/message.rs b/src/message.rs index 03fc2e8c..bbb6a5e0 100644 --- a/src/message.rs +++ b/src/message.rs @@ -207,7 +207,7 @@ impl From for Element { .attr("to", message.to.and_then(|value| Some(String::from(value)))) .attr("id", message.id) .attr("type", message.type_) - .append(message.subjects.iter() + .append(message.subjects.into_iter() .map(|(lang, subject)| { Element::builder("subject") .ns(ns::JABBER_CLIENT) @@ -218,7 +218,7 @@ impl From for Element { .append(subject) .build() }) .collect::>()) - .append(message.bodies.iter() + .append(message.bodies.into_iter() .map(|(lang, body)| { Element::builder("body") .ns(ns::JABBER_CLIENT) diff --git a/src/presence.rs b/src/presence.rs index a0147c7d..098c401a 100644 --- a/src/presence.rs +++ b/src/presence.rs @@ -321,7 +321,7 @@ impl From for Element { .attr("id", presence.id) .attr("type", presence.type_) .append(presence.show) - .append(presence.statuses.iter().map(|(lang, status)| { + .append(presence.statuses.into_iter().map(|(lang, status)| { Element::builder("status") .attr("xml:lang", match lang.as_ref() { "" => None, diff --git a/src/roster.rs b/src/roster.rs index 73522c28..a1ed2dc5 100644 --- a/src/roster.rs +++ b/src/roster.rs @@ -65,7 +65,7 @@ impl From for Element { .attr("jid", String::from(item.jid)) .attr("name", item.name) .attr("subscription", item.subscription) - .append(item.groups.iter().map(|group| Element::builder("group").ns(ns::ROSTER).append(group)).collect::>()) + .append(item.groups.into_iter().map(|group| Element::builder("group").ns(ns::ROSTER).append(group)).collect::>()) .build() } }