Update minidom dependency to 0.11
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
0ef4ba7e55
commit
a1ae45add8
22 changed files with 236 additions and 168 deletions
|
|
@ -10,7 +10,7 @@ use crate::util::error::Error;
|
|||
use crate::ns;
|
||||
use crate::pubsub::{ItemId, NodeName, Subscription, SubscriptionId, Item as PubSubItem};
|
||||
use jid::Jid;
|
||||
use minidom::Element;
|
||||
use minidom::{Element, Node};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
/// Event wrapper for a PubSub `<item/>`.
|
||||
|
|
@ -198,12 +198,12 @@ impl From<PubSubEvent> for Element {
|
|||
PubSubEvent::Configuration { node, form } => Element::builder("configuration")
|
||||
.ns(ns::PUBSUB_EVENT)
|
||||
.attr("node", node)
|
||||
.append(form)
|
||||
.append_all(form.map(Element::from).map(Node::Element).into_iter())
|
||||
.build(),
|
||||
PubSubEvent::Delete { node, redirect } => Element::builder("purge")
|
||||
.ns(ns::PUBSUB_EVENT)
|
||||
.attr("node", node)
|
||||
.append(redirect.map(|redirect| {
|
||||
.append_all(redirect.map(|redirect| {
|
||||
Element::builder("redirect")
|
||||
.ns(ns::PUBSUB_EVENT)
|
||||
.attr("uri", redirect)
|
||||
|
|
@ -213,12 +213,12 @@ impl From<PubSubEvent> for Element {
|
|||
PubSubEvent::PublishedItems { node, items } => Element::builder("items")
|
||||
.ns(ns::PUBSUB_EVENT)
|
||||
.attr("node", node)
|
||||
.append(items)
|
||||
.append_all(items.into_iter())
|
||||
.build(),
|
||||
PubSubEvent::RetractedItems { node, items } => Element::builder("items")
|
||||
.ns(ns::PUBSUB_EVENT)
|
||||
.attr("node", node)
|
||||
.append(
|
||||
.append_all(
|
||||
items
|
||||
.into_iter()
|
||||
.map(|id| {
|
||||
|
|
@ -227,7 +227,6 @@ impl From<PubSubEvent> for Element {
|
|||
.attr("id", id)
|
||||
.build()
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.build(),
|
||||
PubSubEvent::Purge { node } => Element::builder("purge")
|
||||
|
|
|
|||
|
|
@ -219,11 +219,11 @@ impl From<SubscribeOptions> for Element {
|
|||
fn from(subscribe_options: SubscribeOptions) -> Element {
|
||||
Element::builder("subscribe-options")
|
||||
.ns(ns::PUBSUB)
|
||||
.append(if subscribe_options.required {
|
||||
.append_all((if subscribe_options.required {
|
||||
vec![Element::builder("required").ns(ns::PUBSUB).build()]
|
||||
} else {
|
||||
vec![]
|
||||
})
|
||||
}).into_iter())
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
@ -473,7 +473,7 @@ impl From<PubSub> for Element {
|
|||
fn from(pubsub: PubSub) -> Element {
|
||||
Element::builder("pubsub")
|
||||
.ns(ns::PUBSUB)
|
||||
.append(match pubsub {
|
||||
.append_all((match pubsub {
|
||||
PubSub::Create { create, configure } => {
|
||||
let mut elems = vec![Element::from(create)];
|
||||
if let Some(configure) = configure {
|
||||
|
|
@ -498,7 +498,7 @@ impl From<PubSub> for Element {
|
|||
PubSub::Subscription(subscription) => vec![Element::from(subscription)],
|
||||
PubSub::Subscriptions(subscriptions) => vec![Element::from(subscriptions)],
|
||||
PubSub::Unsubscribe(unsubscribe) => vec![Element::from(unsubscribe)],
|
||||
})
|
||||
}).into_iter())
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue