Skip to content

Commit 0368a41

Browse files
authoredMar 7, 2023
feat(server): remove some Unpin and 'static constraints (#3119)
1 parent 0ced15d commit 0368a41

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed
 

‎src/client/conn.rs

+1-1
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

+1-9
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,6 @@ where
768768
/// but it is not desired to actually shutdown the IO object. Instead you
769769
/// would take it back using `into_parts`.
770770
pub fn poll_without_shutdown(&mut self, cx: &mut task::Context<'_>) -> Poll<crate::Result<()>>
771-
where
772-
S: Unpin,
773-
S::Future: Unpin,
774-
B: Unpin,
775771
{
776772
loop {
777773
match *self.conn.as_mut().unwrap() {
@@ -809,10 +805,6 @@ where
809805
///
810806
/// This errors if the underlying connection protocol is not HTTP/1.
811807
pub fn without_shutdown(self) -> impl Future<Output = crate::Result<Parts<I, S>>>
812-
where
813-
S: Unpin,
814-
S::Future: Unpin,
815-
B: Unpin,
816808
{
817809
let mut conn = Some(self);
818810
futures_util::future::poll_fn(move |cx| {
@@ -860,7 +852,7 @@ impl<I, B, S, E> Future for Connection<I, S, E>
860852
where
861853
S: HttpService<Body, ResBody = B>,
862854
S::Error: Into<Box<dyn StdError + Send + Sync>>,
863-
I: AsyncRead + AsyncWrite + Unpin + 'static,
855+
I: AsyncRead + AsyncWrite + Unpin,
864856
B: HttpBody + 'static,
865857
B::Error: Into<Box<dyn StdError + Send + Sync>>,
866858
E: ConnStreamExec<S::Future, B>,

0 commit comments

Comments
 (0)
Please sign in to comment.