mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 16:55:08 +02:00
replace hashbrown with std hashmap
This commit is contained in:
@ -4,7 +4,7 @@ use std::task::{Context, Poll};
|
||||
|
||||
use actix_service::{Service, Transform};
|
||||
use futures::future::{ok, FutureExt, LocalBoxFuture, Ready};
|
||||
use hashbrown::HashMap;
|
||||
use fxhash::FxHashMap;
|
||||
|
||||
use crate::dev::{ServiceRequest, ServiceResponse};
|
||||
use crate::error::{Error, Result};
|
||||
@ -52,13 +52,13 @@ type ErrorHandler<B> = dyn Fn(ServiceResponse<B>) -> Result<ErrorHandlerResponse
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ErrorHandlers<B> {
|
||||
handlers: Rc<HashMap<StatusCode, Box<ErrorHandler<B>>>>,
|
||||
handlers: Rc<FxHashMap<StatusCode, Box<ErrorHandler<B>>>>,
|
||||
}
|
||||
|
||||
impl<B> Default for ErrorHandlers<B> {
|
||||
fn default() -> Self {
|
||||
ErrorHandlers {
|
||||
handlers: Rc::new(HashMap::new()),
|
||||
handlers: Rc::new(FxHashMap::default()),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ where
|
||||
#[doc(hidden)]
|
||||
pub struct ErrorHandlersMiddleware<S, B> {
|
||||
service: S,
|
||||
handlers: Rc<HashMap<StatusCode, Box<ErrorHandler<B>>>>,
|
||||
handlers: Rc<FxHashMap<StatusCode, Box<ErrorHandler<B>>>>,
|
||||
}
|
||||
|
||||
impl<S, B> Service for ErrorHandlersMiddleware<S, B>
|
||||
|
Reference in New Issue
Block a user