1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

replace hashbrown with std hashmap

This commit is contained in:
Nikolay Kim
2019-12-04 18:32:18 +06:00
parent 0015a204aa
commit b45c6cd66b
10 changed files with 22 additions and 23 deletions

View File

@ -1,6 +1,7 @@
use std::collections::hash_map::{self, Entry};
use either::Either;
use hashbrown::hash_map::{self, Entry};
use hashbrown::HashMap;
use fxhash::FxHashMap;
use http::header::{HeaderName, HeaderValue};
use http::HttpTryFrom;
@ -11,7 +12,7 @@ use http::HttpTryFrom;
/// [`HeaderName`]: struct.HeaderName.html
#[derive(Debug, Clone)]
pub struct HeaderMap {
pub(crate) inner: HashMap<HeaderName, Value>,
pub(crate) inner: FxHashMap<HeaderName, Value>,
}
#[derive(Debug, Clone)]
@ -56,7 +57,7 @@ impl HeaderMap {
/// allocate.
pub fn new() -> Self {
HeaderMap {
inner: HashMap::new(),
inner: FxHashMap::default(),
}
}
@ -70,7 +71,7 @@ impl HeaderMap {
/// More capacity than requested may be allocated.
pub fn with_capacity(capacity: usize) -> HeaderMap {
HeaderMap {
inner: HashMap::with_capacity(capacity),
inner: FxHashMap::with_capacity_and_hasher(capacity, Default::default()),
}
}