Skip to content

Commit f7bf6cb

Browse files
committed
Fix stack overflow in heapless octetsbuilder with_capacity
1 parent 3f7797f commit f7bf6cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/builder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ impl<const N: usize> EmptyBuilder for heapless::Vec<u8, N> {
267267

268268
fn with_capacity(capacity: usize) -> Self {
269269
debug_assert!(capacity <= N);
270-
Self::with_capacity(capacity)
270+
// Ignore the capacity because that's determined by the type
271+
heapless::Vec::new()
271272
}
272273
}
273274

0 commit comments

Comments
 (0)