Skip to content

Commit a71c219

Browse files
taikulawooddgrd
authored andcommitted
feat(server): remove some Unpin and 'static constraints (#3119)
1 parent 44a4141 commit a71c219

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/client/conn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ where
547547
#[cfg_attr(feature = "deprecated", allow(deprecated))]
548548
impl<T, B> Future for Connection<T, B>
549549
where
550-
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
550+
T: AsyncRead + AsyncWrite + Unpin + Send,
551551
B: HttpBody + Send + 'static,
552552
B::Data: Send,
553553
B::Error: Into<Box<dyn StdError + Send + Sync>>,

src/server/conn.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -773,10 +773,6 @@ where
773773
/// but it is not desired to actually shutdown the IO object. Instead you
774774
/// would take it back using `into_parts`.
775775
pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll<crate::Result<()>>
776-
where
777-
S: Unpin,
778-
S::Future: Unpin,
779-
B: Unpin,
780776
{
781777
loop {
782778
match *self.conn.as_mut().unwrap() {
@@ -814,10 +810,6 @@ where
814810
///
815811
/// This errors if the underlying connection protocol is not HTTP/1.
816812
pub fn without_shutdown(self) -> impl Future<Output = crate::Result<Parts<I, S>>>
817-
where
818-
S: Unpin,
819-
S::Future: Unpin,
820-
B: Unpin,
821813
{
822814
let mut conn = Some(self);
823815
futures_util::future::poll_fn(move |cx| {
@@ -870,7 +862,7 @@ impl<I, B, S, E> Future for Connection<I, S, E>
870862
where
871863
S: HttpService<Body, ResBody = B>,
872864
S::Error: Into<Box<dyn StdError + Send + Sync>>,
873-
I: AsyncRead + AsyncWrite + Unpin + 'static,
865+
I: AsyncRead + AsyncWrite + Unpin,
874866
B: HttpBody + 'static,
875867
B::Error: Into<Box<dyn StdError + Send + Sync>>,
876868
E: ConnStreamExec<S::Future, B>,

0 commit comments

Comments
 (0)