From 0d4bd274b4f719f5b6637dbb6f84881c68195c48 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 23 Jul 2026 11:39:23 +0300 Subject: [PATCH] style: clear two build warnings - image_model.rs: drop unnecessary parentheses around a map's array literal return. - text_support.rs: remove dead row_in_column / col_rows computation and its unused `li` binding (the only consumer). Co-Authored-By: Claude Fable 5 --- src/entities/text_support.rs | 13 ------------- src/scene/model/image_model.rs | 9 +-------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/entities/text_support.rs b/src/entities/text_support.rs index 09645863c..f6eae80a1 100644 --- a/src/entities/text_support.rs +++ b/src/entities/text_support.rs @@ -1285,18 +1285,6 @@ pub fn layout_mtext(opts: &MTextRenderOpts) -> MTextLayout { } // ── 3. Block geometry (line spacing, attachment, rotation) ─────────── - // Row of each sub-line *within its own column* — the flat index only tracks - // depth down the page when there is one column. Columns sit side by side, so - // each restarts at the top and the block is as deep as its longest one. - let mut col_rows = vec![0usize; cols.count.max(1)]; - let row_in_column: Vec = sub_lines - .iter() - .map(|s| { - let r = col_rows[s.column]; - col_rows[s.column] = r + 1; - r as f32 - }) - .collect(); let ls_factor = if opts.line_spacing_factor > 0.0 { opts.line_spacing_factor } else { @@ -1544,7 +1532,6 @@ pub fn layout_mtext(opts: &MTextRenderOpts) -> MTextLayout { ) }; for (i, sub) in sub_lines.iter().enumerate() { - let li = row_in_column[i]; // The block anchors on its full width; each column then sits at its own // offset inside it and wraps to its own width, not the block's. let (box_left, rect_w) = if cols.active() { diff --git a/src/scene/model/image_model.rs b/src/scene/model/image_model.rs index c8cab5c44..c1f97187d 100644 --- a/src/scene/model/image_model.rs +++ b/src/scene/model/image_model.rs @@ -246,14 +246,7 @@ impl ImageModel { let pts: Vec<[f64; 2]> = u .clip_boundary_vertices .iter() - .map(|p| { - ( - [ - p.x * u.x_scale / w_du, - p.y * u.y_scale / h_du, - ] - ) - }) + .map(|p| [p.x * u.x_scale / w_du, p.y * u.y_scale / h_du]) .collect(); let mut tris = Vec::with_capacity((pts.len().saturating_sub(2)) * 3); for i in 1..pts.len() - 1 {