Skip to content

Commit

Permalink
Merge branch 'development' into ho_fix_unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
SWvheerden authored Sep 22, 2023
2 parents 6475ef7 + 467a8d4 commit 59b9f3b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions comms/core/src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,7 @@ pub trait MessageExt: prost::Message {
/// Encodes a message, allocating the buffer on the heap as necessary
fn to_encoded_bytes(&self) -> Vec<u8>
where Self: Sized {
let mut buf = Vec::with_capacity(self.encoded_len());
self.encode(&mut buf).expect(
"prost::Message::encode documentation says it is infallible unless the buffer has insufficient capacity. \
This buffer's capacity was set with encoded_len",
);
buf
self.encode_to_vec()
}

/// Encodes a message into a BytesMut, allocating the buffer on the heap as necessary.
Expand Down

0 comments on commit 59b9f3b

Please sign in to comment.