Skip to content

Removed unnecessary 'static & Unpin bounds from body generic #649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/client.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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