From eb6abb5d670799e9e1d9a1a4784305aadf5a6914 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Fri, 18 Nov 2022 10:57:59 -0500 Subject: [PATCH] fix: avoid unneeded allocation --- wal/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wal/src/lib.rs b/wal/src/lib.rs index 550b731a87..e19af40a2d 100644 --- a/wal/src/lib.rs +++ b/wal/src/lib.rs @@ -543,14 +543,14 @@ impl SegmentFileReader { } async fn is_segment_stream(f: &mut Pin>) -> Result<()> { - let mut header = vec![0u8; FILE_TYPE_IDENTIFIER.len()]; + let mut header = [0u8; FILE_TYPE_IDENTIFIER.len()]; f.read_exact(&mut header) .await .context(UnableToReadFileMetadataSnafu)?; ensure!( header == FILE_TYPE_IDENTIFIER, - SegmentFileIdentifierMismatchSnafu {} + SegmentFileIdentifierMismatchSnafu, ); Ok(())