minidom: clippy

Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2025-11-01 15:31:30 +01:00
commit 9595ffe2c2
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2
3 changed files with 6 additions and 8 deletions

View file

@ -1,4 +1,6 @@
Version NEXT:
* Changes
- Fix some Clippy warnings
Version 0.18, released 2025-10-28:
* Breaking:

View file

@ -425,7 +425,7 @@ impl Element {
writer.write(Item::ElementHeadStart(&namespace, (*self.name).try_into()?))?;
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() {

View file

@ -85,7 +85,7 @@ impl TreeBuilder {
/// Lookup XML namespace declaration for given prefix (or no prefix)
#[must_use]
fn lookup_prefix<'a>(
prefixes_stack: &'a Vec<Prefixes>,
prefixes_stack: &'a [Prefixes],
prefix: &'a Option<String>,
) -> Option<&'a str> {
for nss in prefixes_stack.iter().rev() {
@ -149,11 +149,7 @@ impl TreeBuilder {
.push((prefix.to_string(), name.to_string(), value));
}
(None, name) => {
attrs.insert(
Namespace::NONE,
name.try_into().unwrap(),
value.as_str().to_owned(),
);
attrs.insert(Namespace::NONE, name, value.as_str().to_owned());
}
}
}
@ -179,7 +175,7 @@ impl TreeBuilder {
&Some(prefix.to_string()),
)
.map(String::from)
.map(|s| TryInto::<Namespace>::try_into(s).unwrap())
.map(Into::<Namespace>::into)
.ok_or(Error::MissingNamespace)?
.to_owned()
};