diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 73e3099b1..0044acb8c 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -32,8 +32,7 @@ use crate::{ config::ServiceConfig, error::{DispatchError, ParseError, PayloadError}, service::HttpFlow, - ConnectionType, Error, Extensions, HttpMessage, OnConnectData, Request, Response, - StatusCode, + ConnectionType, Error, Extensions, HttpMessage, OnConnectData, Request, Response, StatusCode, }; const LW_BUFFER_SIZE: usize = 1024; @@ -383,7 +382,10 @@ where } } - fn poll_linger(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Result, DispatchError> { + fn poll_linger( + mut self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Result, DispatchError> { if self.as_mut().poll_flush(cx)?.is_pending() { return Ok(Poll::Pending); } @@ -459,7 +461,11 @@ where self.as_mut().project().state.set(State::None); } - _ => self.as_mut().project().state.set(State::SendPayload { body }), + _ => self + .as_mut() + .project() + .state + .set(State::SendPayload { body }), } Ok(()) @@ -598,10 +604,8 @@ where // this.payload was the payload for the request we just finished // responding to. We can check to see if we finished reading it // yet, and if not, shutdown the connection. - let linger = should_linger( - this.payload.as_ref(), - *this.payload_drainable, - ); + let linger = + should_linger(this.payload.as_ref(), *this.payload_drainable); let not_pipelined = this.messages.is_empty(); // payload stream finished. @@ -652,10 +656,8 @@ where // this.payload was the payload for the request we just finished // responding to. We can check to see if we finished reading it // yet, and if not, shutdown the connection. - let linger = should_linger( - this.payload.as_ref(), - *this.payload_drainable, - ); + let linger = + should_linger(this.payload.as_ref(), *this.payload_drainable); let not_pipelined = this.messages.is_empty(); // payload stream finished. diff --git a/actix-http/src/h1/dispatcher_tests.rs b/actix-http/src/h1/dispatcher_tests.rs index dbb20327c..f85b6c0ac 100644 --- a/actix-http/src/h1/dispatcher_tests.rs +++ b/actix-http/src/h1/dispatcher_tests.rs @@ -87,8 +87,8 @@ fn drop_payload_service() -> impl Service impl Service, Error = Error> -{ +fn ignore_payload_service( +) -> impl Service, Error = Error> { fn_service(|_req: Request| ready(Ok::<_, Error>(Response::with_body(StatusCode::OK, "ok")))) }