minidom: clippy
Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
parent
d60f718955
commit
9595ffe2c2
3 changed files with 6 additions and 8 deletions
|
|
@ -1,4 +1,6 @@
|
||||||
Version NEXT:
|
Version NEXT:
|
||||||
|
* Changes
|
||||||
|
- Fix some Clippy warnings
|
||||||
|
|
||||||
Version 0.18, released 2025-10-28:
|
Version 0.18, released 2025-10-28:
|
||||||
* Breaking:
|
* Breaking:
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ impl Element {
|
||||||
writer.write(Item::ElementHeadStart(&namespace, (*self.name).try_into()?))?;
|
writer.write(Item::ElementHeadStart(&namespace, (*self.name).try_into()?))?;
|
||||||
|
|
||||||
for ((ns, key), value) in &self.attributes {
|
for ((ns, key), value) in &self.attributes {
|
||||||
writer.write(Item::Attribute(&ns, key, value))?;
|
writer.write(Item::Attribute(ns, key, value))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !self.children.is_empty() {
|
if !self.children.is_empty() {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ impl TreeBuilder {
|
||||||
/// Lookup XML namespace declaration for given prefix (or no prefix)
|
/// Lookup XML namespace declaration for given prefix (or no prefix)
|
||||||
#[must_use]
|
#[must_use]
|
||||||
fn lookup_prefix<'a>(
|
fn lookup_prefix<'a>(
|
||||||
prefixes_stack: &'a Vec<Prefixes>,
|
prefixes_stack: &'a [Prefixes],
|
||||||
prefix: &'a Option<String>,
|
prefix: &'a Option<String>,
|
||||||
) -> Option<&'a str> {
|
) -> Option<&'a str> {
|
||||||
for nss in prefixes_stack.iter().rev() {
|
for nss in prefixes_stack.iter().rev() {
|
||||||
|
|
@ -149,11 +149,7 @@ impl TreeBuilder {
|
||||||
.push((prefix.to_string(), name.to_string(), value));
|
.push((prefix.to_string(), name.to_string(), value));
|
||||||
}
|
}
|
||||||
(None, name) => {
|
(None, name) => {
|
||||||
attrs.insert(
|
attrs.insert(Namespace::NONE, name, value.as_str().to_owned());
|
||||||
Namespace::NONE,
|
|
||||||
name.try_into().unwrap(),
|
|
||||||
value.as_str().to_owned(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -179,7 +175,7 @@ impl TreeBuilder {
|
||||||
&Some(prefix.to_string()),
|
&Some(prefix.to_string()),
|
||||||
)
|
)
|
||||||
.map(String::from)
|
.map(String::from)
|
||||||
.map(|s| TryInto::<Namespace>::try_into(s).unwrap())
|
.map(Into::<Namespace>::into)
|
||||||
.ok_or(Error::MissingNamespace)?
|
.ok_or(Error::MissingNamespace)?
|
||||||
.to_owned()
|
.to_owned()
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue