[librsvg/librsvg-2.46] font_props: prefer "if let"



commit 04e27ed9f686747845504f5730a857e1110a415b
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Oct 13 12:50:23 2019 +0200

    font_props: prefer "if let"

 rsvg_internals/src/font_props.rs | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/font_props.rs b/rsvg_internals/src/font_props.rs
index 7461842f..9ce3f3dd 100644
--- a/rsvg_internals/src/font_props.rs
+++ b/rsvg_internals/src/font_props.rs
@@ -210,10 +210,9 @@ impl Parse for LetterSpacingSpec {
                     })?;
 
                     if let Token::Ident(ref cow) = token {
-                        match cow.as_ref() {
-                            "normal" => return Ok(LetterSpacingSpec::Normal),
-                            _ => (),
-                        };
+                        if let "normal" = cow.as_ref() {
+                            return Ok(LetterSpacingSpec::Normal);
+                        }
                     }
                 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]