diff --git a/src/data_forms.rs b/src/data_forms.rs index d4678c0..bccdca0 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 37c54f7..59dc15d 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 03fc2e8..bbb6a5e 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 a0147c7..098c401 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 73522c2..a1ed2dc 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() } }