data_forms, ibr, message, presence, roster: Always use into_iter.

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-20 23:09:22 +01:00
parent f6f6faeb77
commit 5df585ca40
5 changed files with 7 additions and 7 deletions

View file

@ -72,7 +72,7 @@ impl From<Field> 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::<Vec<_>>())
.append(field.media)

View file

@ -69,8 +69,8 @@ impl From<Query> 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::<Vec<_>>())
.append(if query.remove { Some(Element::builder("remove").ns(ns::REGISTER)) } else { None })
.append(query.form)

View file

@ -207,7 +207,7 @@ impl From<Message> 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<Message> for Element {
.append(subject)
.build() })
.collect::<Vec<_>>())
.append(message.bodies.iter()
.append(message.bodies.into_iter()
.map(|(lang, body)| {
Element::builder("body")
.ns(ns::JABBER_CLIENT)

View file

@ -321,7 +321,7 @@ impl From<Presence> 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,

View file

@ -65,7 +65,7 @@ impl From<Item> 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::<Vec<_>>())
.append(item.groups.into_iter().map(|group| Element::builder("group").ns(ns::ROSTER).append(group)).collect::<Vec<_>>())
.build()
}
}