diff --git a/proxmox-async/src/blocking/wrapped_reader_stream.rs b/proxmox-async/src/blocking/wrapped_reader_stream.rs index 3a13f5f5..08b826bd 100644 --- a/proxmox-async/src/blocking/wrapped_reader_stream.rs +++ b/proxmox-async/src/blocking/wrapped_reader_stream.rs @@ -4,6 +4,8 @@ use std::task::{Context, Poll}; use futures::stream::Stream; +use proxmox_io::vec; + use crate::runtime::block_in_place; /// Wrapper struct to convert sync [Read] into a [Stream] @@ -14,11 +16,7 @@ pub struct WrappedReaderStream { impl WrappedReaderStream { pub fn new(reader: R) -> Self { - let mut buffer = Vec::with_capacity(64 * 1024); - unsafe { - buffer.set_len(buffer.capacity()); - } - Self { reader, buffer } + Self { reader, buffer: vec::undefined(64 * 1024) } } }