Skip to content

Commit

Permalink
feat(server): remove some Unpin and 'static constraints (#3119)
Browse files Browse the repository at this point in the history
  • Loading branch information
taikulawo committed Mar 7, 2023
1 parent 0ced15d commit 0368a41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/client/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ where
#[cfg_attr(feature = "deprecated", allow(deprecated))]
impl<T, B> Future for Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
Expand Down
10 changes: 1 addition & 9 deletions src/server/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<crate::Result<()>>
where
S: Unpin,
S::Future: Unpin,
B: Unpin,
{
loop {
match *self.conn.as_mut().unwrap() {
Expand Down Expand Up @@ -809,10 +805,6 @@ where
///
/// This errors if the underlying connection protocol is not HTTP/1.
pub fn without_shutdown(self) -> impl Future<Output = crate::Result<Parts<I, S>>>
where
S: Unpin,
S::Future: Unpin,
B: Unpin,
{
let mut conn = Some(self);
futures_util::future::poll_fn(move |cx| {
Expand Down Expand Up @@ -860,7 +852,7 @@ impl<I, B, S, E> Future for Connection<I, S, E>
where
S: HttpService<Body, ResBody = B>,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
I: AsyncRead + AsyncWrite + Unpin + 'static,
I: AsyncRead + AsyncWrite + Unpin,
B: HttpBody + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
E: ConnStreamExec<S::Future, B>,
Expand Down

0 comments on commit 0368a41

Please sign in to comment.