[librsvg: 3/8] Fix clippy warning for single-branch `match`
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 3/8] Fix clippy warning for single-branch `match`
- Date: Fri, 15 Oct 2021 21:01:05 +0000 (UTC)
commit 1787599866373426c6c68ce5f7041158815b1589
Author: Michael Howell <michael notriddle com>
Date: Wed Oct 13 13:43:46 2021 -0700
Fix clippy warning for single-branch `match`
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/606>
src/element.rs | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/src/element.rs b/src/element.rs
index 782acf67..78215028 100644
--- a/src/element.rs
+++ b/src/element.rs
@@ -204,20 +204,17 @@ impl<T: SetAttributes + Draw> ElementInner<T> {
fn set_language_attribute(&mut self) -> Result<(), ElementError> {
for (attr, value) in self.attributes.iter() {
- match attr.expanded() {
- expanded_name!(xml "lang") => {
- self.language = Some(
- LanguageTag::from_str(value)
- .map_err(|e| {
- ValueErrorKind::parse_error(&format!(
- "invalid language tag: \"{}\"",
- e
- ))
- })
- .attribute(attr)?,
- );
- }
- _ => {}
+ if attr.expanded() == expanded_name!(xml "lang") {
+ self.language = Some(
+ LanguageTag::from_str(value)
+ .map_err(|e| {
+ ValueErrorKind::parse_error(&format!(
+ "invalid language tag: \"{}\"",
+ e
+ ))
+ })
+ .attribute(attr)?,
+ );
}
}
Ok(())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]