From 010b5dd66d8c6ce13556eb8e26ec18cd081514da Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 17 Dec 2021 04:21:42 +0000 Subject: [PATCH] fmt --- actix-http/src/h1/dispatcher.rs | 56 +++++++++++++++------------------ 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index e601c5e30..472845e65 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -46,6 +46,11 @@ bitflags! { } } +// there's 2 versions of Dispatcher state because of: +// https://github.com/taiki-e/pin-project-lite/issues/3 +// +// tl;dr: pin-project-lite doesn't play well with other attribute macros + #[cfg(not(test))] pin_project! { /// Dispatcher for HTTP/1.1 protocol @@ -67,37 +72,6 @@ pin_project! { } } -// there's 2 versions of dispatcher state because of: -// https://github.com/taiki-e/pin-project-lite/issues/3 -// -// tl;dr: pin-project-lite doesn't play well with other attribute macros - -pin_project! { - #[project = DispatcherStateProj] - enum DispatcherState - where - S: Service, - S::Error: Into>, - - B: MessageBody, - - X: Service, - X::Error: Into>, - - U: Service<(Request, Framed), Response = ()>, - U::Error: fmt::Display, - { - Normal { - #[pin] - inner: InnerDispatcher, - }, - Upgrade { - #[pin] - fut: U::Future, - }, - } -} - #[cfg(test)] pin_project! { /// Dispatcher for HTTP/1.1 protocol @@ -122,6 +96,26 @@ pin_project! { } } +pin_project! { + #[project = DispatcherStateProj] + enum DispatcherState + where + S: Service, + S::Error: Into>, + + B: MessageBody, + + X: Service, + X::Error: Into>, + + U: Service<(Request, Framed), Response = ()>, + U::Error: fmt::Display, + { + Normal { #[pin] inner: InnerDispatcher }, + Upgrade { #[pin] fut: U::Future }, + } +} + pin_project! { #[project = InnerDispatcherProj] struct InnerDispatcher