1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 16:55:08 +02:00

Expose factory traits and some clippy fixes (#983)

This commit is contained in:
Ravi Shankar
2019-07-17 12:28:42 +05:30
committed by Nikolay Kim
parent c01611d8b5
commit 32718b7e31
13 changed files with 16 additions and 9 deletions

View File

@ -192,6 +192,7 @@ pub struct UrlEncoded<U> {
impl<U> UrlEncoded<U> {
/// Create a new future to URL encode a request
#[allow(clippy::borrow_interior_mutable_const)]
pub fn new(req: &HttpRequest, payload: &mut Payload) -> UrlEncoded<U> {
// check content type
if req.content_type().to_lowercase() != "application/x-www-form-urlencoded" {

View File

@ -298,6 +298,7 @@ where
U: DeserializeOwned + 'static,
{
/// Create `JsonBody` for request.
#[allow(clippy::borrow_interior_mutable_const)]
pub fn new(
req: &HttpRequest,
payload: &mut Payload,

View File

@ -298,6 +298,7 @@ pub struct HttpMessageBody {
impl HttpMessageBody {
/// Create `MessageBody` for request.
#[allow(clippy::borrow_interior_mutable_const)]
pub fn new(req: &HttpRequest, payload: &mut dev::Payload) -> HttpMessageBody {
let mut len = None;
if let Some(l) = req.headers().get(&header::CONTENT_LENGTH) {