From 09d1344d617605558a01dd50408ce2ebf08eeccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 8 Feb 2022 14:33:50 +0100 Subject: [PATCH] proxmox-async: another clippy fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- proxmox-async/src/blocking/wrapped_reader_stream.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) } } }