Inconsistent capacity handling in `HeaderMap::with_capacity`
https://github.com/hyperium/http/blob/9c05e391e00474abaa8c14a86bcb0fc5eff1120e/src/header/map.rs#L473
https://github.com/hyperium/http/blob/9c05e391e00474abaa8c14a86bcb0fc5eff1120e/src/header/map.rs#L635
https://github.com/hyperium/http/blob/9c05e391e00474abaa8c14a86bcb0fc5eff1120e/src/header/map.rs#L1592
HeaderMap::with_capacity reserves the entry vector with Vec::with_capacity(raw_cap), while other functions reserves the same entry with Vec::with_capacity(usable_capacity(raw_cap)).
@Qwaz could you provide some additional details on why this is incorrect? Thanks!
@hawkw This is not an incorrect code in terms of correctness, but we can improve the consistency of the code and save a bit of memory by changing HeaderMap::with_capacity to use Vec::with_capacity(usable_capacity(raw_cap)) instead of Vec::with_capacity(raw_cap).
@Qwaz ah, okay, I misunderstood — I thought that since this was linked in the "Audit http" issue on safety-dance, this was part of the security audit. Thanks for clearing that up.