From 9595ffe2c28af127588d22c05833e09ae74aff18 Mon Sep 17 00:00:00 2001 From: pep Date: Sat, 1 Nov 2025 15:31:30 +0100 Subject: [PATCH] minidom: clippy Signed-off-by: pep --- minidom/CHANGELOG.md | 2 ++ minidom/src/element.rs | 2 +- minidom/src/tree_builder.rs | 10 +++------- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/minidom/CHANGELOG.md b/minidom/CHANGELOG.md index 61af4ebc9253e1a8fe2267ae9fc324c0bd348c6f..28f185f28da77b61367f515b623f8015748b2b23 100644 --- a/minidom/CHANGELOG.md +++ b/minidom/CHANGELOG.md @@ -1,4 +1,6 @@ Version NEXT: + * Changes + - Fix some Clippy warnings Version 0.18, released 2025-10-28: * Breaking: diff --git a/minidom/src/element.rs b/minidom/src/element.rs index e66566fda4198d007d38a55338ba261f6526b820..05267598926a5376eec3d6212757766d1577a074 100644 --- a/minidom/src/element.rs +++ b/minidom/src/element.rs @@ -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() { diff --git a/minidom/src/tree_builder.rs b/minidom/src/tree_builder.rs index 81f8f027619b6530e2092e8e227e13dffc8b2ddf..d0fd92ad720027782f90d892e8546e55b64b5a29 100644 --- a/minidom/src/tree_builder.rs +++ b/minidom/src/tree_builder.rs @@ -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_stack: &'a [Prefixes], prefix: &'a Option, ) -> 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::::try_into(s).unwrap()) + .map(Into::::into) .ok_or(Error::MissingNamespace)? .to_owned() };