From ba9b0ab251dbec0b2cf778437f017ad6eaa3f2f7 Mon Sep 17 00:00:00 2001 From: koe Date: Sat, 31 Aug 2024 14:48:08 -0500 Subject: [PATCH] try_for_each --- crates/bevy_text/src/pipeline.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/bevy_text/src/pipeline.rs b/crates/bevy_text/src/pipeline.rs index e4f037191571b..288278e65dd92 100644 --- a/crates/bevy_text/src/pipeline.rs +++ b/crates/bevy_text/src/pipeline.rs @@ -186,7 +186,7 @@ impl TextPipeline { .iter() .map(move |layout_glyph| (layout_glyph, run.line_y)) }) - .map(|(layout_glyph, line_y)| { + .try_for_each(|(layout_glyph, line_y)| { let section_index = layout_glyph.metadata; let font_handle = sections[section_index].style.font.clone_weak(); @@ -230,8 +230,7 @@ impl TextPipeline { PositionedGlyph::new(position, glyph_size.as_vec2(), atlas_info, section_index); layout_info.glyphs.push(pos_glyph); Ok(()) - }) - .collect::>()?; + })?; layout_info.size = box_size; Ok(())