Skip to content

Commit 2018225

Browse files
committed
impl Default for message::Builder<HeapAllocator>
1 parent 867cedc commit 2018225

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

capnp/src/message.rs

+9
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,15 @@ impl Builder<HeapAllocator> {
765765
/// Constructs a new `message::Builder<HeapAllocator>` whose first segment has length
766766
/// `SUGGESTED_FIRST_SEGMENT_WORDS`.
767767
pub fn new_default() -> Self {
768+
Default::default()
769+
}
770+
}
771+
772+
#[cfg(feature = "alloc")]
773+
impl Default for Builder<HeapAllocator> {
774+
/// Constructs a new `message::Builder<HeapAllocator>` whose first segment has length
775+
/// `SUGGESTED_FIRST_SEGMENT_WORDS`.
776+
fn default() -> Self {
768777
Self::new(HeapAllocator::new())
769778
}
770779
}

0 commit comments

Comments
 (0)