Use option for pubsub#owner delete redirect element

This commit is contained in:
Paul Fariello 2020-09-28 23:06:45 +02:00
commit a5a24a243d

View file

@ -69,7 +69,7 @@ generate_element!(
], ],
children: [ children: [
/// Redirection to replace the deleted node. /// Redirection to replace the deleted node.
redirect: Vec<Redirect> = ("redirect", PUBSUB_OWNER) => Redirect redirect: Option<Redirect> = ("redirect", PUBSUB_OWNER) => Redirect
] ]
); );
@ -300,9 +300,9 @@ mod tests {
let pubsub = PubSubOwner::Delete(Delete { let pubsub = PubSubOwner::Delete(Delete {
node: NodeName(String::from("foo")), node: NodeName(String::from("foo")),
redirect: vec![Redirect { redirect: Some(Redirect {
uri: String::from("xmpp:hamlet@denmark.lit?;node=blog"), uri: String::from("xmpp:hamlet@denmark.lit?;node=blog"),
}], }),
}); });
let elem2 = Element::from(pubsub); let elem2 = Element::from(pubsub);