1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-23 00:26:34 +00:00

reduce one clone on Arc. (#1850)

This commit is contained in:
fakeshadow 2020-12-24 07:58:25 +08:00 committed by GitHub
parent 3a192400a6
commit 87655b3028
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,7 +183,7 @@ where
let config = JsonConfig::from_req(req);
let limit = config.limit;
let ctype = config.content_type.clone();
let ctype = config.content_type.as_deref();
let err_handler = config.err_handler.clone();
JsonExtractFut {
@ -361,7 +361,7 @@ where
pub fn new(
req: &HttpRequest,
payload: &mut Payload,
ctype: Option<Arc<dyn Fn(mime::Mime) -> bool + Send + Sync>>,
ctype: Option<&(dyn Fn(mime::Mime) -> bool + Send + Sync)>,
) -> Self {
// check content-type
let json = if let Ok(Some(mime)) = req.mime_type() {