From d77c21279c256d254ed368763feaefff0913e3de Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 2 May 2022 11:44:56 +0100 Subject: [PATCH] svg size handling: SVG is case sensitive bundles.rs had this right. Signed-off-by: Ian Jackson --- src/utils.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index f0770f58..023d9764 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -235,7 +235,7 @@ pub fn svg_parse_size(xml: &str) -> Option> { for token in &mut tokens { match token? { Tk::ElementStart{ local, .. } => { - if local.eq_ignore_ascii_case("svg") { break } + if local.as_str() == "svg" { break } else { throw!(SvSE::WrongFirstElement) } } _ => { }, @@ -249,9 +249,11 @@ pub fn svg_parse_size(xml: &str) -> Option> { break }, Tk::Attribute { local, value, .. } => { - let i = - if local.eq_ignore_ascii_case("width" ) { 0 } else - if local.eq_ignore_ascii_case("height") { 1 } else { continue }; + let i = match local.as_str() { + "width" => 0, + "height" => 1, + _ => continue, + }; if wh[i].is_some() { throw!(SvSE::AttributeRepeated(local.to_string())) } -- 2.30.2