From: Ian Jackson Date: Mon, 2 May 2022 10:44:56 +0000 (+0100) Subject: svg size handling: SVG is case sensitive X-Git-Tag: otter-1.1.0~310 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d77c21279c256d254ed368763feaefff0913e3de;p=otter.git svg size handling: SVG is case sensitive bundles.rs had this right. Signed-off-by: Ian Jackson --- 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())) }