From 83319ed67479a545987ab77d29b8c026c855e3d3 Mon Sep 17 00:00:00 2001 From: dlzht Date: Tue, 2 Jul 2024 12:57:45 +0800 Subject: [PATCH] fix: capacity handling in HeaderMap::try_with_capacity(#353) --- src/header/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/header/map.rs b/src/header/map.rs index a668b311..c5deacfc 100644 --- a/src/header/map.rs +++ b/src/header/map.rs @@ -521,7 +521,7 @@ impl HeaderMap { Ok(HeaderMap { mask: (raw_cap - 1) as Size, indices: vec![Pos::none(); raw_cap].into_boxed_slice(), - entries: Vec::with_capacity(raw_cap), + entries: Vec::with_capacity(usable_capacity(raw_cap)), extra_values: Vec::new(), danger: Danger::Green, })