Skip to content

Commit 7b78fc6

Browse files
committed
remove 'static lifetime bound on http1/2 client IO
1 parent e77cefe commit 7b78fc6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/client/conn/http1.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct Parts<T> {
5151
#[must_use = "futures do nothing unless polled"]
5252
pub struct Connection<T, B>
5353
where
54-
T: Read + Write + 'static,
54+
T: Read + Write,
5555
B: Body + 'static,
5656
{
5757
inner: Dispatcher<T, B>,
@@ -124,7 +124,7 @@ pub struct Builder {
124124
/// See [`client::conn`](crate::client::conn) for more.
125125
pub async fn handshake<T, B>(io: T) -> crate::Result<(SendRequest<B>, Connection<T, B>)>
126126
where
127-
T: Read + Write + Unpin + 'static,
127+
T: Read + Write + Unpin,
128128
B: Body + 'static,
129129
B::Data: Send,
130130
B::Error: Into<Box<dyn StdError + Send + Sync>>,
@@ -239,7 +239,7 @@ impl<B> fmt::Debug for SendRequest<B> {
239239

240240
impl<T, B> Connection<T, B>
241241
where
242-
T: Read + Write + Unpin + Send + 'static,
242+
T: Read + Write + Unpin + Send,
243243
B: Body + 'static,
244244
B::Error: Into<Box<dyn StdError + Send + Sync>>,
245245
{
@@ -253,7 +253,7 @@ where
253253

254254
impl<T, B> fmt::Debug for Connection<T, B>
255255
where
256-
T: Read + Write + fmt::Debug + 'static,
256+
T: Read + Write + fmt::Debug,
257257
B: Body + 'static,
258258
{
259259
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -263,7 +263,7 @@ where
263263

264264
impl<T, B> Future for Connection<T, B>
265265
where
266-
T: Read + Write + Unpin + 'static,
266+
T: Read + Write + Unpin,
267267
B: Body + 'static,
268268
B::Data: Send,
269269
B::Error: Into<Box<dyn StdError + Send + Sync>>,
@@ -501,7 +501,7 @@ impl Builder {
501501
io: T,
502502
) -> impl Future<Output = crate::Result<(SendRequest<B>, Connection<T, B>)>>
503503
where
504-
T: Read + Write + Unpin + 'static,
504+
T: Read + Write + Unpin,
505505
B: Body + 'static,
506506
B::Data: Send,
507507
B::Error: Into<Box<dyn StdError + Send + Sync>>,

src/client/conn/http2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<B> Clone for SendRequest<B> {
4040
#[must_use = "futures do nothing unless polled"]
4141
pub struct Connection<T, B, E>
4242
where
43-
T: Read + Write + 'static + Unpin,
43+
T: Read + Write + Unpin,
4444
B: Body + 'static,
4545
E: Http2ClientConnExec<B, T> + Unpin,
4646
B::Error: Into<Box<dyn Error + Send + Sync>>,
@@ -70,7 +70,7 @@ pub async fn handshake<E, T, B>(
7070
io: T,
7171
) -> crate::Result<(SendRequest<B>, Connection<T, B, E>)>
7272
where
73-
T: Read + Write + Unpin + 'static,
73+
T: Read + Write + Unpin,
7474
B: Body + 'static,
7575
B::Data: Send,
7676
B::Error: Into<Box<dyn Error + Send + Sync>>,
@@ -432,7 +432,7 @@ where
432432
io: T,
433433
) -> impl Future<Output = crate::Result<(SendRequest<B>, Connection<T, B, Ex>)>>
434434
where
435-
T: Read + Write + Unpin + 'static,
435+
T: Read + Write + Unpin,
436436
B: Body + 'static,
437437
B::Data: Send,
438438
B::Error: Into<Box<dyn Error + Send + Sync>>,

src/proto/h2/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub(crate) async fn handshake<T, B, E>(
137137
timer: Time,
138138
) -> crate::Result<ClientTask<B, E, T>>
139139
where
140-
T: Read + Write + Unpin + 'static,
140+
T: Read + Write + Unpin,
141141
B: Body + 'static,
142142
B::Data: Send + 'static,
143143
E: Http2ClientConnExec<B, T> + Unpin,

0 commit comments

Comments
 (0)