Skip to content

Commit

Permalink
Remove unnecessary Unpin + 'static bounds on body (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsiam committed Dec 12, 2022
1 parent af47a08 commit c1ce37e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/client.rs
Expand Up @@ -341,7 +341,7 @@ pub(crate) struct Peer;

impl<B> SendRequest<B>
where
B: Buf + 'static,
B: Buf,
{
/// Returns `Ready` when the connection can initialize a new HTTP/2
/// stream.
Expand Down Expand Up @@ -584,7 +584,7 @@ where

impl<B> Future for ReadySendRequest<B>
where
B: Buf + 'static,
B: Buf,
{
type Output = Result<SendRequest<B>, crate::Error>;

Expand Down Expand Up @@ -1100,7 +1100,7 @@ impl Builder {
) -> impl Future<Output = Result<(SendRequest<B>, Connection<T, B>), crate::Error>>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
Connection::handshake2(io, self.clone())
}
Expand Down Expand Up @@ -1177,7 +1177,7 @@ where
impl<T, B> Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
async fn handshake2(
mut io: T,
Expand Down Expand Up @@ -1306,7 +1306,7 @@ where
impl<T, B> Future for Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
type Output = Result<(), crate::Error>;

Expand Down
5 changes: 1 addition & 4 deletions src/proto/streams/streams.rs
Expand Up @@ -1229,10 +1229,7 @@ impl<B> StreamRef<B> {
.map_err(From::from)
}

pub fn clone_to_opaque(&self) -> OpaqueStreamRef
where
B: 'static,
{
pub fn clone_to_opaque(&self) -> OpaqueStreamRef {
self.opaque.clone()
}

Expand Down
8 changes: 4 additions & 4 deletions src/server.rs
Expand Up @@ -364,7 +364,7 @@ where
impl<T, B> Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
fn handshake2(io: T, builder: Builder) -> Handshake<T, B> {
let span = tracing::trace_span!("server_handshake");
Expand Down Expand Up @@ -582,7 +582,7 @@ where
impl<T, B> futures_core::Stream for Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
type Item = Result<(Request<RecvStream>, SendResponse<B>), crate::Error>;

Expand Down Expand Up @@ -1007,7 +1007,7 @@ impl Builder {
pub fn handshake<T, B>(&self, io: T) -> Handshake<T, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
Connection::handshake2(io, self.clone())
}
Expand Down Expand Up @@ -1262,7 +1262,7 @@ where
impl<T, B: Buf> Future for Handshake<T, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + 'static,
B: Buf,
{
type Output = Result<Connection<T, B>, crate::Error>;

Expand Down
2 changes: 1 addition & 1 deletion tests/h2-support/src/client_ext.rs
Expand Up @@ -11,7 +11,7 @@ pub trait SendRequestExt {

impl<B> SendRequestExt for SendRequest<B>
where
B: Buf + Unpin + 'static,
B: Buf,
{
fn get(&mut self, uri: &str) -> ResponseFuture {
let req = Request::builder()
Expand Down
2 changes: 1 addition & 1 deletion tests/h2-support/src/prelude.rs
Expand Up @@ -90,7 +90,7 @@ pub trait ClientExt {
impl<T, B> ClientExt for client::Connection<T, B>
where
T: AsyncRead + AsyncWrite + Unpin + 'static,
B: Buf + Unpin + 'static,
B: Buf,
{
fn run<'a, F: Future + Unpin + 'a>(
&'a mut self,
Expand Down

0 comments on commit c1ce37e

Please sign in to comment.