diff --git a/src/ext.rs b/src/ext.rs index 02f7a28..dc648b5 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -5,7 +5,7 @@ use std::iter; use smallvec::SmallVec; /// Max size of memory allowed to be allocated on the stack. -pub const STACK_MEM_ALLOC_MAX: usize = 4096; +pub const STACK_MEM_ALLOC_MAX: usize = 2048; // 2KB /// A stack-allocated vector that spills onto the heap when needed. pub type StackVec = SmallVec<[T; STACK_MEM_ALLOC_MAX]>; diff --git a/src/message/tests.rs b/src/message/tests.rs index 07cfe7c..e4a05ad 100644 --- a/src/message/tests.rs +++ b/src/message/tests.rs @@ -12,9 +12,9 @@ where S: MessageSender, println!(">> Created message: {:?}", message); let serialised = message.serialise(s).expect("Failed to serialise message"); println!(">> Serialised message: {:?}", serialised); - let binary = serialised.into_bytes(); + let binary = serialised.into_bytes().expect("Failed to serialize to bytes"); println!(">> Written to {} bytes", binary.len()); - let read = SerializedMessage::from_bytes(&binary).expect("Failed to read serialised message from binary"); + let read = SerializedMessage::from_bytes(binary).expect("Failed to read serialised message from binary"); println!(">> Read from bytes: {:?}", read); let deserialised = Message::deserialize(&read, d).expect("Failed to deserialise message"); println!(">> Deserialised message: {:?}", deserialised);