diff --git a/render-wasm/src/shapes/text.rs b/render-wasm/src/shapes/text.rs index bce3fda8c3..d56d2e6f28 100644 --- a/render-wasm/src/shapes/text.rs +++ b/render-wasm/src/shapes/text.rs @@ -80,7 +80,7 @@ impl TextContent { self.paragraphs.push(paragraph); } - pub fn paragraphs(&self) -> &Vec { + pub fn paragraphs(&self) -> &[Paragraph] { &self.paragraphs } @@ -194,8 +194,7 @@ impl Paragraph { self.children = children; } - #[allow(dead_code)] - pub fn get_children(&self) -> &Vec { + pub fn children(&self) -> &[TextLeaf] { &self.children } diff --git a/render-wasm/src/textlayout.rs b/render-wasm/src/textlayout.rs index 29c45d119c..3be44c1d85 100644 --- a/render-wasm/src/textlayout.rs +++ b/render-wasm/src/textlayout.rs @@ -64,7 +64,7 @@ pub fn paragraph_builders_from_text( for paragraph in text_content.paragraphs() { let paragraph_style = paragraph.paragraph_to_style(); let mut builder = ParagraphBuilder::new(¶graph_style, fonts); - for leaf in paragraph.get_children() { + for leaf in paragraph.children() { let text_style = leaf.to_style( &text_content.bounds(), fallback_fonts, @@ -99,7 +99,7 @@ pub fn stroke_paragraph_builders_from_text( let mut stroke_paragraphs_map: std::collections::HashMap = std::collections::HashMap::new(); - for leaf in paragraph.get_children().iter() { + for leaf in paragraph.children().iter() { let mut text_paint = merge_fills(leaf.fills(), *bounds); if let Some(blur_mask) = blur_mask { text_paint.set_mask_filter(blur_mask.clone());