diff --git a/rust/src/zstd_compress_dictionary.rs b/rust/src/zstd_compress_dictionary.rs index 0671d834a..bb99d5dd5 100644 --- a/rust/src/zstd_compress_dictionary.rs +++ b/rust/src/zstd_compress_dictionary.rs @@ -2883,8 +2883,7 @@ mod tests { return ptr::null_mut(); } - let mut allocation = Vec::::with_capacity(size); - allocation.resize(size, 0); + let mut allocation = vec![0u8; size]; let buffer = allocation.as_mut_ptr(); probe.allocation = buffer; probe.allocation_capacity = allocation.capacity();