fix: use namespace_declaration_overrides

This commit is contained in:
cel 🌸 2024-11-24 15:09:05 +00:00
parent 35f164cdb6
commit 880194d811
2 changed files with 9 additions and 24 deletions

View File

@ -21,7 +21,7 @@ impl IntoElement for StartTls {
namespace: Some(XMLNS.to_string()), namespace: Some(XMLNS.to_string()),
local_name: "required".to_string(), local_name: "required".to_string(),
}, },
namespace_declarations: HashSet::new(), namespace_declaration_overrides: HashSet::new(),
attributes: HashMap::new(), attributes: HashMap::new(),
content: Vec::new(), content: Vec::new(),
}); });
@ -29,17 +29,12 @@ impl IntoElement for StartTls {
} else { } else {
content = Vec::new(); content = Vec::new();
} }
let mut namespace_declarations = HashSet::new();
namespace_declarations.insert(NamespaceDeclaration {
prefix: None,
namespace: XMLNS.to_string(),
});
Element { Element {
name: Name { name: Name {
namespace: Some(XMLNS.to_string()), namespace: Some(XMLNS.to_string()),
local_name: "starttls".to_string(), local_name: "starttls".to_string(),
}, },
namespace_declarations, namespace_declaration_overrides: HashSet::new(),
attributes: HashMap::new(), attributes: HashMap::new(),
content, content,
} }
@ -90,17 +85,12 @@ pub struct Proceed;
impl IntoElement for Proceed { impl IntoElement for Proceed {
fn into_element(&self) -> Element { fn into_element(&self) -> Element {
let mut namespace_declarations = HashSet::new();
namespace_declarations.insert(NamespaceDeclaration {
prefix: None,
namespace: XMLNS.to_string(),
});
Element { Element {
name: Name { name: Name {
namespace: Some(XMLNS.to_string()), namespace: Some(XMLNS.to_string()),
local_name: "proceed".to_string(), local_name: "proceed".to_string(),
}, },
namespace_declarations, namespace_declaration_overrides: HashSet::new(),
attributes: HashMap::new(), attributes: HashMap::new(),
content: Vec::new(), content: Vec::new(),
} }
@ -128,17 +118,12 @@ pub struct Failure;
impl IntoElement for Failure { impl IntoElement for Failure {
fn into_element(&self) -> Element { fn into_element(&self) -> Element {
let mut namespace_declarations = HashSet::new();
namespace_declarations.insert(NamespaceDeclaration {
prefix: None,
namespace: XMLNS.to_string(),
});
Element { Element {
name: Name { name: Name {
namespace: Some(XMLNS.to_string()), namespace: Some(XMLNS.to_string()),
local_name: "failure".to_string(), local_name: "failure".to_string(),
}, },
namespace_declarations, namespace_declaration_overrides: HashSet::new(),
attributes: HashMap::new(), attributes: HashMap::new(),
content: Vec::new(), content: Vec::new(),
} }

View File

@ -62,12 +62,12 @@ impl FromElement for Stream {
impl IntoElement for Stream { impl IntoElement for Stream {
fn into_element(&self) -> Element { fn into_element(&self) -> Element {
let mut namespace_declarations = HashSet::new(); let mut namespace_declaration_overrides = HashSet::new();
namespace_declarations.insert(NamespaceDeclaration { namespace_declaration_overrides.insert(NamespaceDeclaration {
prefix: Some("stream".to_string()), prefix: Some("stream".to_string()),
namespace: XMLNS.to_string(), namespace: XMLNS.to_string(),
}); });
namespace_declarations.insert(NamespaceDeclaration { namespace_declaration_overrides.insert(NamespaceDeclaration {
prefix: None, prefix: None,
// TODO: don't default to client // TODO: don't default to client
namespace: XMLNS_CLIENT.to_string(), namespace: XMLNS_CLIENT.to_string(),
@ -125,7 +125,7 @@ impl IntoElement for Stream {
namespace: Some(XMLNS.to_string()), namespace: Some(XMLNS.to_string()),
local_name: "stream".to_string(), local_name: "stream".to_string(),
}, },
namespace_declarations, namespace_declaration_overrides,
attributes, attributes,
content: Vec::new(), content: Vec::new(),
} }
@ -185,7 +185,7 @@ impl IntoElement for Features {
namespace: Some(XMLNS.to_string()), namespace: Some(XMLNS.to_string()),
local_name: "features".to_string(), local_name: "features".to_string(),
}, },
namespace_declarations: HashSet::new(), namespace_declaration_overrides: HashSet::new(),
attributes: HashMap::new(), attributes: HashMap::new(),
content, content,
} }