Repository: bevyengine/bevy
File: crates/bevy_text/src/pipeline.rs (Rust)

Code before:
            buffer.set_size(font_system, Some(dimensions.x), bounds.height);
        }

        // Recover the spans buffer.
        spans.clear();
        self.spans_buffer = spans
            .into_iter()
            .map(|_| -> (usize, &'static str, &'static TextFont, FontFaceInfo) { unreachable!() })
            .collect();

        Ok(())
    }

    /// Queues text for rendering
    ///
    /// Produces a [`TextLayoutInfo`], containing [`PositionedGlyph`]s
    /// which contain information for rendering the text.
    pub fn queue_text<'a>(
        &mut self,
        layout_info: &mut TextLayoutInfo,
        fonts: &Assets<Font>,
        text_spans: impl Iterator<Item = (Entity, usize, &'a str, &'a TextFont, Color)>,
        scale_factor: f64,
        layout: &TextLayout,
        bounds: TextBounds,
        font_atlas_sets: &mut FontAtlasSet,
        texture_atlases: &mut Assets<TextureAtlasLayout>,
        textures: &mut Assets<Image>,
        computed: &mut ComputedTextBlock,
        font_system: &mut CosmicFontSystem,
        swash_cache: &mut SwashCache,
    ) -> Result<(), TextError> {
        layout_info.glyphs.clear();
        layout_info.section_rects.clear();
        layout_info.size = Default::default();

        // Clear this here at the focal point of text rendering to ensure the field's lifecycle has strong boundaries.
        computed.needs_rerender = false;

        // Extract font ids from the iterator while traversing it.
        let mut glyph_info = core::mem::take(&mut self.glyph_info);
        glyph_info.clear();
        let text_spans = text_spans.inspect(|(_, _, _, text_font, _)| {
            glyph_info.push((text_font.font.id(), text_font.font_smoothing));
        });

        let update_result = self.update_buffer(
            fonts,
            text_spans,
            layout.linebreak,
            layout.justify,

Review comment (suggestion):
```suggestion
        font_atlas_set: &mut FontAtlasSet,
```

Code after:
            buffer.set_size(font_system, Some(dimensions.x), bounds.height);
        }

        // Recover the spans buffer.
        spans.clear();
        self.spans_buffer = spans
            .into_iter()
            .map(|_| -> (usize, &'static str, &'static TextFont, FontFaceInfo) { unreachable!() })
            .collect();

        Ok(())
    }

    /// Queues text for rendering
    ///
    /// Produces a [`TextLayoutInfo`], containing [`PositionedGlyph`]s
    /// which contain information for rendering the text.
    pub fn queue_text<'a>(
        &mut self,
        layout_info: &mut TextLayoutInfo,
        fonts: &Assets<Font>,
        text_spans: impl Iterator<Item = (Entity, usize, &'a str, &'a TextFont, Color)>,
        scale_factor: f64,
        layout: &TextLayout,
        bounds: TextBounds,
        font_atlas_set: &mut FontAtlasSet,
        texture_atlases: &mut Assets<TextureAtlasLayout>,
        textures: &mut Assets<Image>,
        computed: &mut ComputedTextBlock,
        font_system: &mut CosmicFontSystem,
        swash_cache: &mut SwashCache,
    ) -> Result<(), TextError> {
        layout_info.glyphs.clear();
        layout_info.section_rects.clear();
        layout_info.size = Default::default();

        // Clear this here at the focal point of text rendering to ensure the field's lifecycle has strong boundaries.
        computed.needs_rerender = false;

        // Extract font ids from the iterator while traversing it.
        let mut glyph_info = core::mem::take(&mut self.glyph_info);
        glyph_info.clear();
        let text_spans = text_spans.inspect(|(_, _, _, text_font, _)| {
            glyph_info.push((text_font.font.id(), text_font.font_smoothing));
        });

        let update_result = self.update_buffer(
            fonts,
            text_spans,
            layout.linebreak,
            layout.justify,