diff --git a/meilisearch-http/src/extractors/jayson.rs b/meilisearch-http/src/extractors/jayson.rs index 20a03dfb2..aaa370fbe 100644 --- a/meilisearch-http/src/extractors/jayson.rs +++ b/meilisearch-http/src/extractors/jayson.rs @@ -59,9 +59,10 @@ where type Output = Result, actix_web::Error>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let this = self.get_mut(); + let ValidatedJsonExtractFut { fut, .. } = self.get_mut(); + let fut = Pin::new(fut); - let res = ready!(Pin::new(&mut this.fut).poll(cx)); + let res = ready!(fut.poll(cx)); let res = match res { Err(err) => Err(err), diff --git a/meilisearch-http/src/lib.rs b/meilisearch-http/src/lib.rs index bfdb829d4..9f15d90e8 100644 --- a/meilisearch-http/src/lib.rs +++ b/meilisearch-http/src/lib.rs @@ -84,17 +84,19 @@ pub fn configure_data( web::JsonConfig::default() .content_type(|mime| mime == mime::APPLICATION_JSON) .error_handler(|err, req: &HttpRequest| match err { - JsonPayloadError::ContentType => match req.headers().get(CONTENT_TYPE) { - Some(content_type) => MeilisearchHttpError::InvalidContentType( - content_type.to_str().unwrap_or("unknown").to_string(), - vec![mime::APPLICATION_JSON.to_string()], - ) - .into(), - None => MeilisearchHttpError::MissingContentType(vec![ - mime::APPLICATION_JSON.to_string(), - ]) - .into(), - }, + JsonPayloadError::ContentType => { + match req.headers().get(CONTENT_TYPE) { + Some(content_type) => MeilisearchHttpError::InvalidContentType( + content_type.to_str().unwrap_or("unknown").to_string(), + vec![mime::APPLICATION_JSON.to_string()], + ) + .into(), + None => MeilisearchHttpError::MissingContentType(vec![ + mime::APPLICATION_JSON.to_string(), + ]) + .into(), + } + } err => PayloadError::from(err).into(), }), )