From ea2deffde1e902e399764dd90c747a872157267b Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Sat, 14 Nov 2026 10:28:44 +0530 Subject: [PATCH] style(svg): format craft-svg delegation in text_within --- crates/svg/src/lib.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/svg/src/lib.rs b/crates/svg/src/lib.rs index 23cc07d3c1..b035e6cd10 100644 --- a/crates/svg/src/lib.rs +++ b/crates/svg/src/lib.rs @@ -491,16 +491,10 @@ pub(crate) fn text_within<'a>(bytes: &'a [u8], unpacked: &std::sync::atomic::Ato match craft_svg::svgz::inflate(bytes, most) { Ok(raw) => { unpacked.fetch_add(raw.len() as u64, Ordering::Relaxed); - craft_svg::svgz::decode(&raw) - .map(|t| std::borrow::Cow::Owned(t.into_owned())) - .map_err(|_| not_utf8()) - } - Err(craft_svg::svgz::Error::TooLarge(_)) => { - Err(SvgError::TooBig(format!("the SVGZ file unpacks to more than {} MB", most >> 20))) - } - Err(craft_svg::svgz::Error::Corrupt(e)) => { - Err(SvgError::Parse(format!("not a valid SVGZ file: {e}"))) + craft_svg::svgz::decode(&raw).map(|t| std::borrow::Cow::Owned(t.into_owned())).map_err(|_| not_utf8()) } + Err(craft_svg::svgz::Error::TooLarge(_)) => Err(SvgError::TooBig(format!("the SVGZ file unpacks to more than {} MB", most >> 20))), + Err(craft_svg::svgz::Error::Corrupt(e)) => Err(SvgError::Parse(format!("not a valid SVGZ file: {e}"))), Err(craft_svg::svgz::Error::Encoding) => Err(not_utf8()), Err(e) => Err(SvgError::Parse(e.to_string())), }