summaryrefslogtreecommitdiff
path: root/crates/typst-layout
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-layout')
-rw-r--r--crates/typst-layout/src/flow/compose.rs2
-rw-r--r--crates/typst-layout/src/grid/layouter.rs2
-rw-r--r--crates/typst-layout/src/math/stretch.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/crates/typst-layout/src/flow/compose.rs b/crates/typst-layout/src/flow/compose.rs
index 76af8f65..54dc487a 100644
--- a/crates/typst-layout/src/flow/compose.rs
+++ b/crates/typst-layout/src/flow/compose.rs
@@ -115,7 +115,7 @@ impl<'a, 'b> Composer<'a, 'b, '_, '_> {
let column_height = regions.size.y;
let backlog: Vec<_> = std::iter::once(&column_height)
.chain(regions.backlog)
- .flat_map(|&h| std::iter::repeat(h).take(self.config.columns.count))
+ .flat_map(|&h| std::iter::repeat_n(h, self.config.columns.count))
.skip(1)
.collect();
diff --git a/crates/typst-layout/src/grid/layouter.rs b/crates/typst-layout/src/grid/layouter.rs
index af47ff72..dc9e2238 100644
--- a/crates/typst-layout/src/grid/layouter.rs
+++ b/crates/typst-layout/src/grid/layouter.rs
@@ -1469,7 +1469,7 @@ impl<'a> GridLayouter<'a> {
// last height is the one for the current region.
rowspan
.heights
- .extend(std::iter::repeat(Abs::zero()).take(amount_missing_heights));
+ .extend(std::iter::repeat_n(Abs::zero(), amount_missing_heights));
// Ensure that, in this region, the rowspan will span at least
// this row.
diff --git a/crates/typst-layout/src/math/stretch.rs b/crates/typst-layout/src/math/stretch.rs
index dafa8cbe..f45035e2 100644
--- a/crates/typst-layout/src/math/stretch.rs
+++ b/crates/typst-layout/src/math/stretch.rs
@@ -302,6 +302,6 @@ fn assemble(
fn parts(assembly: GlyphAssembly, repeat: usize) -> impl Iterator<Item = GlyphPart> + '_ {
assembly.parts.into_iter().flat_map(move |part| {
let count = if part.part_flags.extender() { repeat } else { 1 };
- std::iter::repeat(part).take(count)
+ std::iter::repeat_n(part, count)
})
}