From 87655b3028eab8f077089725e476b6141e45b469 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Thu, 24 Dec 2020 07:58:25 +0800 Subject: [PATCH] reduce one clone on Arc. (#1850) --- src/types/json.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/json.rs b/src/types/json.rs index 95613a0c..dc0870a6 100644 --- a/src/types/json.rs +++ b/src/types/json.rs @@ -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 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() {