From 0368a41a6cc1a5c6f1eada0d88e38b7dce261587 Mon Sep 17 00:00:00 2001 From: wuweichao Date: Wed, 8 Mar 2023 05:20:11 +0800 Subject: [PATCH] feat(server): remove some `Unpin` and `'static` constraints (#3119) --- src/client/conn.rs | 2 +- src/server/conn.rs | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/client/conn.rs b/src/client/conn.rs index 3a6fb88a3a..88e2c413a7 100644 --- a/src/client/conn.rs +++ b/src/client/conn.rs @@ -547,7 +547,7 @@ where #[cfg_attr(feature = "deprecated", allow(deprecated))] impl Future for Connection where - T: AsyncRead + AsyncWrite + Unpin + Send + 'static, + T: AsyncRead + AsyncWrite + Unpin + Send, B: HttpBody + Send + 'static, B::Data: Send, B::Error: Into>, diff --git a/src/server/conn.rs b/src/server/conn.rs index d5370b0f14..f0379d950c 100644 --- a/src/server/conn.rs +++ b/src/server/conn.rs @@ -768,10 +768,6 @@ where /// but it is not desired to actually shutdown the IO object. Instead you /// would take it back using `into_parts`. pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll> - where - S: Unpin, - S::Future: Unpin, - B: Unpin, { loop { match *self.conn.as_mut().unwrap() { @@ -809,10 +805,6 @@ where /// /// This errors if the underlying connection protocol is not HTTP/1. pub fn without_shutdown(self) -> impl Future>> - where - S: Unpin, - S::Future: Unpin, - B: Unpin, { let mut conn = Some(self); futures_util::future::poll_fn(move |cx| { @@ -860,7 +852,7 @@ impl Future for Connection where S: HttpService, S::Error: Into>, - I: AsyncRead + AsyncWrite + Unpin + 'static, + I: AsyncRead + AsyncWrite + Unpin, B: HttpBody + 'static, B::Error: Into>, E: ConnStreamExec,