diff --git a/ciborium/src/ser/mod.rs b/ciborium/src/ser/mod.rs index 4bf393b..1699fa9 100644 --- a/ciborium/src/ser/mod.rs +++ b/ciborium/src/ser/mod.rs @@ -738,7 +738,7 @@ where fn to_vec_small( value: &T, ) -> Result, Error> { - let mut buffer = Vec::with_capacity(256); + let mut buffer = Vec::with_capacity(32); let mut serializer: Serializer<_, C> = Serializer::new(&mut buffer); value.serialize(&mut serializer)?; Ok(buffer) @@ -765,7 +765,7 @@ fn to_vec_small( #[cfg(feature = "std")] #[inline] pub fn to_vec(value: &T) -> Result, Error> { - let mut buffer = Vec::with_capacity(1024); + let mut buffer = Vec::with_capacity(128); let mut serializer: Serializer<_, NoCanonicalization> = Serializer::new(&mut buffer); value.serialize(&mut serializer)?; Ok(buffer) @@ -795,7 +795,7 @@ pub fn to_vec(value: &T) -> Result, Error( value: &T, ) -> Result, Error> { - let mut buffer = Vec::with_capacity(1024); + let mut buffer = Vec::with_capacity(128); let mut serializer: Serializer<_, C> = Serializer::new(&mut buffer); value.serialize(&mut serializer)?; Ok(buffer)