diff options
| author | evie <50974538+mi2ebi@users.noreply.github.com> | 2025-03-11 03:00:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-11 10:00:53 +0000 |
| commit | 3650859ae8823f47c9f50db6ad5ed52a0477bf15 (patch) | |
| tree | ccb21d73c0263019744ea5e8276fbda91ee4f7f5 /crates/typst-render/src | |
| parent | bd531e08dc3dbe26ac779d5730bf0814800b7de9 (diff) | |
Fix `cargo clippy` warnings (mostly about `.repeat.take` and `.next_back`) (#6038)
Diffstat (limited to 'crates/typst-render/src')
| -rw-r--r-- | crates/typst-render/src/shape.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/typst-render/src/shape.rs b/crates/typst-render/src/shape.rs index ba7ed6d8..9b50d5f1 100644 --- a/crates/typst-render/src/shape.rs +++ b/crates/typst-render/src/shape.rs @@ -69,9 +69,11 @@ pub fn render_shape(canvas: &mut sk::Pixmap, state: State, shape: &Shape) -> Opt let dash = dash.as_ref().and_then(to_sk_dash_pattern); let bbox = shape.geometry.bbox_size(); - let offset_bbox = (!matches!(shape.geometry, Geometry::Line(..))) - .then(|| offset_bounding_box(bbox, *thickness)) - .unwrap_or(bbox); + let offset_bbox = if !matches!(shape.geometry, Geometry::Line(..)) { + offset_bounding_box(bbox, *thickness) + } else { + bbox + }; let fill_transform = (!matches!(shape.geometry, Geometry::Line(..))).then(|| { |
