From 8ed9be0a0f519174d373ea3b1d5e9e3829d1bee8 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 21 Oct 2024 15:59:57 -0400 Subject: [PATCH] Update martin/src/sprites/mod.rs Co-authored-by: Frank Elsinga --- martin/src/sprites/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/martin/src/sprites/mod.rs b/martin/src/sprites/mod.rs index 05e17694b..033f9631f 100644 --- a/martin/src/sprites/mod.rs +++ b/martin/src/sprites/mod.rs @@ -188,10 +188,11 @@ async fn parse_sprite( .map_err(|e| SpriteParsingError(e, path.clone()))?; let sprite = if as_sdf { - Sprite::new_sdf(tree, pixel_ratio).ok_or_else(|| SpriteInstError(path.clone()))? + Sprite::new_sdf(tree, pixel_ratio) } else { - Sprite::new(tree, pixel_ratio).ok_or_else(|| SpriteInstError(path.clone()))? + Sprite::new(tree, pixel_ratio) }; + let sprite = sprite.ok_or_else(|| SpriteInstError(path.clone()))?; Ok((name, sprite)) }