From 552852318207badeb6abb8f09b388dd594a93000 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 19 Feb 2026 09:15:06 -0700 Subject: [PATCH] Fix compilation for no_std --- src/shape.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shape.rs b/src/shape.rs index fe6bb4b..4eee7a2 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -8,9 +8,7 @@ use crate::{ FontSystem, Hinting, LayoutGlyph, LayoutLine, Metrics, Wrap, }; #[cfg(not(feature = "std"))] -use alloc::format; -#[cfg(not(feature = "std"))] -use alloc::vec::Vec; +use alloc::{format, vec, vec::Vec}; use alloc::collections::VecDeque; use core::cmp::{max, min}; @@ -1860,7 +1858,11 @@ impl ShapeLine { /// Returns the words for a given span index, handling the ellipsis sentinel. fn get_span_words(&self, span_index: usize) -> &[ShapeWord] { if span_index == ELLIPSIS_SPAN { - &self.ellipsis_span.as_ref().unwrap().words + &self + .ellipsis_span + .as_ref() + .expect("ellipsis_span not set") + .words } else { &self.spans[span_index].words }