Skip to content

Commit 5eb346f

Browse files
s3bkpcwalton
authored andcommitted
Add an Outline::with_capacity() method
1 parent 4dea6aa commit 5eb346f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

content/src/outline.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ impl Outline {
6161
}
6262
}
6363

64+
/// Returns a new `Outline` with storage for `capacity` contours preallocated.
65+
#[inline]
66+
pub fn with_capacity(capacity: usize) -> Outline {
67+
Outline {
68+
contours: Vec::with_capacity(capacity),
69+
bounds: RectF::default(),
70+
}
71+
}
72+
6473
#[inline]
6574
pub fn from_segments<I>(segments: I) -> Outline
6675
where

0 commit comments

Comments
 (0)