Skip to content

Commit b5e70a0

Browse files
committed
refactor(server): remove more 'static bounds on Server
1 parent 8b878a8 commit b5e70a0

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/server/conn.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ pub(crate) mod spawn_all {
902902
impl<I, S, E> Watcher<I, S, E> for NoopWatcher
903903
where
904904
I: AsyncRead + AsyncWrite + Unpin + Send + 'static,
905-
S: HttpService<Body> + 'static,
905+
S: HttpService<Body>,
906906
<S::ResBody as Payload>::Data: Unpin,
907907
E: H2Exec<S::Future, S::ResBody>,
908908
{
@@ -1017,7 +1017,7 @@ mod upgrades {
10171017

10181018
impl<I, B, S, E> UpgradeableConnection<I, S, E>
10191019
where
1020-
S: HttpService<Body, ResBody=B>,// + 'static,
1020+
S: HttpService<Body, ResBody=B>,
10211021
S::Error: Into<Box<dyn StdError + Send + Sync>>,
10221022
I: AsyncRead + AsyncWrite + Unpin,
10231023
B: Payload + 'static,
@@ -1035,7 +1035,7 @@ mod upgrades {
10351035

10361036
impl<I, B, S, E> Future for UpgradeableConnection<I, S, E>
10371037
where
1038-
S: HttpService<Body, ResBody=B> + 'static,
1038+
S: HttpService<Body, ResBody=B>,
10391039
S::Error: Into<Box<dyn StdError + Send + Sync>>,
10401040
I: AsyncRead + AsyncWrite + Unpin + Send + 'static,
10411041
B: Payload + 'static,

src/server/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ where
149149
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
150150
S: MakeServiceRef<IO, Body, ResBody=B>,
151151
S::Error: Into<Box<dyn StdError + Send + Sync>>,
152-
S::Service: 'static,
153152
B: Payload,
154153
B::Data: Unpin,
155154
E: H2Exec<<S::Service as HttpService<Body>>::Future, B>,
@@ -206,7 +205,6 @@ where
206205
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
207206
S: MakeServiceRef<IO, Body, ResBody=B>,
208207
S::Error: Into<Box<dyn StdError + Send + Sync>>,
209-
S::Service: 'static,
210208
B: Payload,
211209
B::Data: Unpin,
212210
E: H2Exec<<S::Service as HttpService<Body>>::Future, B>,
@@ -392,7 +390,6 @@ impl<I, E> Builder<I, E> {
392390
I::Conn: AsyncRead + AsyncWrite + Unpin + Send + 'static,
393391
S: MakeServiceRef<I::Conn, Body, ResBody=B>,
394392
S::Error: Into<Box<dyn StdError + Send + Sync>>,
395-
S::Service: 'static,
396393
B: Payload,
397394
B::Data: Unpin,
398395
E: NewSvcExec<I::Conn, S::Future, S::Service, E, NoopWatcher>,

src/server/shutdown.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ where
5050
IE: Into<Box<dyn StdError + Send + Sync>>,
5151
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
5252
S: MakeServiceRef<IO, Body, ResBody=B>,
53-
S::Service: 'static,
5453
S::Error: Into<Box<dyn StdError + Send + Sync>>,
5554
B: Payload,
5655
B::Data: Unpin,
@@ -106,7 +105,7 @@ pub struct GracefulWatcher(Watch);
106105
impl<I, S, E> Watcher<I, S, E> for GracefulWatcher
107106
where
108107
I: AsyncRead + AsyncWrite + Unpin + Send + 'static,
109-
S: HttpService<Body> + 'static,
108+
S: HttpService<Body>,
110109
<S::ResBody as Payload>::Data: Unpin,
111110
E: H2Exec<S::Future, S::ResBody>,
112111
{

0 commit comments

Comments
 (0)