mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-30 18:44:35 +01:00
reduce one clone on Arc. (#1850)
This commit is contained in:
parent
3a192400a6
commit
87655b3028
@ -183,7 +183,7 @@ where
|
|||||||
let config = JsonConfig::from_req(req);
|
let config = JsonConfig::from_req(req);
|
||||||
|
|
||||||
let limit = config.limit;
|
let limit = config.limit;
|
||||||
let ctype = config.content_type.clone();
|
let ctype = config.content_type.as_deref();
|
||||||
let err_handler = config.err_handler.clone();
|
let err_handler = config.err_handler.clone();
|
||||||
|
|
||||||
JsonExtractFut {
|
JsonExtractFut {
|
||||||
@ -361,7 +361,7 @@ where
|
|||||||
pub fn new(
|
pub fn new(
|
||||||
req: &HttpRequest,
|
req: &HttpRequest,
|
||||||
payload: &mut Payload,
|
payload: &mut Payload,
|
||||||
ctype: Option<Arc<dyn Fn(mime::Mime) -> bool + Send + Sync>>,
|
ctype: Option<&(dyn Fn(mime::Mime) -> bool + Send + Sync)>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// check content-type
|
// check content-type
|
||||||
let json = if let Ok(Some(mime)) = req.mime_type() {
|
let json = if let Ok(Some(mime)) = req.mime_type() {
|
||||||
|
Loading…
Reference in New Issue
Block a user