[librsvg: 2/4] Make units case insensitive




commit 717e575855c16dd3c79c7fd69f362f4724825d37
Author: Kolja Lampe <klampe slashwhy de>
Date:   Fri Oct 15 11:05:00 2021 +0200

    Make units case insensitive
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/608>

 src/length.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/length.rs b/src/length.rs
index 803af877..e10c32e9 100644
--- a/src/length.rs
+++ b/src/length.rs
@@ -42,7 +42,7 @@
 //!
 //! [diag]: https://www.w3.org/TR/SVG/coords.html#Units
 
-use cssparser::{Parser, Token};
+use cssparser::{match_ignore_ascii_case, Parser, Token, _cssparser_internal_to_lowercase};
 use std::f64::consts::*;
 use std::marker::PhantomData;
 
@@ -276,7 +276,7 @@ impl<N: Normalize, V: Validate> Parse for CssLength<N, V> {
             } => {
                 l_value = value;
 
-                l_unit = match unit.as_ref() {
+                l_unit = match_ignore_ascii_case! {unit.as_ref(),
                     "px" => LengthUnit::Px,
                     "em" => LengthUnit::Em,
                     "ex" => LengthUnit::Ex,


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