Skip to content

Commit

Permalink
remove 'static lifetime bound on http1/2 client IO
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraef committed May 13, 2024
1 parent e77cefe commit 7b78fc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/client/conn/http1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct Parts<T> {
#[must_use = "futures do nothing unless polled"]
pub struct Connection<T, B>
where
T: Read + Write + 'static,
T: Read + Write,
B: Body + 'static,
{
inner: Dispatcher<T, B>,
Expand Down Expand Up @@ -124,7 +124,7 @@ pub struct Builder {
/// See [`client::conn`](crate::client::conn) for more.
pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
where
T: Read + Write + Unpin + 'static,
T: Read + Write + Unpin,
B: Body + 'static,
B::Data: Send,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
Expand Down Expand Up @@ -239,7 +239,7 @@ impl<B> fmt::Debug for SendRequest<B> {

impl<T, B> Connection<T, B>
where
T: Read + Write + Unpin + Send + 'static,
T: Read + Write + Unpin + Send,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
{
Expand All @@ -253,7 +253,7 @@ where

impl<T, B> fmt::Debug for Connection<T, B>
where
T: Read + Write + fmt::Debug + 'static,
T: Read + Write + fmt::Debug,
B: Body + 'static,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand All @@ -263,7 +263,7 @@ where

impl<T, B> Future for Connection<T, B>
where
T: Read + Write + Unpin + 'static,
T: Read + Write + Unpin,
B: Body + 'static,
B::Data: Send,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
Expand Down Expand Up @@ -501,7 +501,7 @@ impl Builder {
io: T,
) -> impl Future<Output = crate::Result<(SendRequest<B>, Connection<T, B>)>>
where
T: Read + Write + Unpin + 'static,
T: Read + Write + Unpin,
B: Body + 'static,
B::Data: Send,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
Expand Down
6 changes: 3 additions & 3 deletions src/client/conn/http2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<B> Clone for SendRequest<B> {
#[must_use = "futures do nothing unless polled"]
pub struct Connection<T, B, E>
where
T: Read + Write + 'static + Unpin,
T: Read + Write + Unpin,
B: Body + 'static,
E: Http2ClientConnExec<B, T> + Unpin,
B::Error: Into<Box<dyn Error + Send + Sync>>,
Expand Down Expand Up @@ -70,7 +70,7 @@ pub async fn handshake<E, T, B>(
io: T,
) -> crate::Result<(SendRequest<B>, Connection<T, B, E>)>
where
T: Read + Write + Unpin + 'static,
T: Read + Write + Unpin,
B: Body + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>,
Expand Down Expand Up @@ -432,7 +432,7 @@ where
io: T,
) -> impl Future<Output = crate::Result<(SendRequest<B>, Connection<T, B, Ex>)>>
where
T: Read + Write + Unpin + 'static,
T: Read + Write + Unpin,
B: Body + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>,
Expand Down
2 changes: 1 addition & 1 deletion src/proto/h2/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub(crate) async fn handshake<T, B, E>(
timer: Time,
) -> crate::Result<ClientTask<B, E, T>>
where
T: Read + Write + Unpin + 'static,
T: Read + Write + Unpin,
B: Body + 'static,
B::Data: Send + 'static,
E: Http2ClientConnExec<B, T> + Unpin,
Expand Down

0 comments on commit 7b78fc6

Please sign in to comment.