Commit 54b74ee 1 parent 237b333 commit 54b74ee Copy full SHA for 54b74ee
File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ This release has an [MSRV][] of 1.65.
21
21
- Implement ` Sum ` for ` Vec2 ` . ([ #399 ] [ ] by [ @Philipp-M ] [ ] )
22
22
- Add triangle shape. ([ #350 ] [ ] by [ @juliapaci ] [ ] )
23
23
- Add ` Vec2::turn_90 ` and ` Vec2::rotate_scale ` methods ([ #409 ] by [ @raphlinus ] [ ] )
24
+ - Add ` BezPath::with_capacity ` method ([ #418 ] by [ @LaurenzV ] [ ] )
24
25
25
26
### Changed
26
27
@@ -69,6 +70,7 @@ Note: A changelog was not kept for or before this release
69
70
[ @dominikh ] : https://github.com/dominikh
70
71
[ @GabrielDertoni ] : https://github.com/GabrielDertoni
71
72
[ @juliapaci ] : https://github.com/juliapaci
73
+ [ @LaurenzV ] : https://github.com/LaurenzV
72
74
[ @nils-mathieu ] : https://github.com/nils-mathieu
73
75
[ @Philipp-M ] : https://github.com/Philipp-M
74
76
[ @platlas ] : https://github.com/platlas
@@ -101,6 +103,7 @@ Note: A changelog was not kept for or before this release
101
103
[ #390 ] : https://github.com/linebender/kurbo/pull/390
102
104
[ #399 ] : https://github.com/linebender/kurbo/pull/399
103
105
[ #409 ] : https://github.com/linebender/kurbo/pull/409
106
+ [ #418 ] : https://github.com/linebender/kurbo/pull/418
104
107
105
108
[ Unreleased ] : https://github.com/linebender/kurbo/compare/v0.11.1...HEAD
106
109
[ 0.11.0 ] : https://github.com/linebender/kurbo/releases/tag/v0.11.0
Original file line number Diff line number Diff line change @@ -179,6 +179,14 @@ impl BezPath {
179
179
Default :: default ( )
180
180
}
181
181
182
+ /// Create a new path with the specified capacity.
183
+ ///
184
+ /// This can be useful if you already know how many path elements the path
185
+ /// will consist of, to prevent reallocations.
186
+ pub fn with_capacity ( capacity : usize ) -> BezPath {
187
+ BezPath ( Vec :: with_capacity ( capacity) )
188
+ }
189
+
182
190
/// Create a path from a vector of path elements.
183
191
///
184
192
/// `BezPath` also implements `FromIterator<PathEl>`, so it works with `collect`:
You can’t perform that action at this time.
0 commit comments