Skip to content

Commit 16e834d

Browse files
spindaseanmonstar
authored andcommitted
feat(server): remove unneeded Send + Sync from Server
Http and Server placed Send + Sync bounds on NewService implementations which were not actually required given tokio's event loop model. Remove them to reduce limitations on end users of hyper.
1 parent 0c7d375 commit 16e834d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/server/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ impl<B: AsRef<[u8]> + 'static> Http<B> {
9696
/// The returned `Server` contains one method, `run`, which is used to
9797
/// actually run the server.
9898
pub fn bind<S, Bd>(&self, addr: &SocketAddr, new_service: S) -> ::Result<Server<S, Bd>>
99-
where S: NewService<Request = Request, Response = Response<Bd>, Error = ::Error> +
100-
Send + Sync + 'static,
99+
where S: NewService<Request = Request, Response = Response<Bd>, Error = ::Error> + 'static,
101100
Bd: Stream<Item=B, Error=::Error>,
102101
{
103102
let core = try!(Core::new());
@@ -378,8 +377,7 @@ impl<T, B> Service for HttpService<T>
378377
}
379378

380379
impl<S, B> Server<S, B>
381-
where S: NewService<Request = Request, Response = Response<B>, Error = ::Error>
382-
+ Send + Sync + 'static,
380+
where S: NewService<Request = Request, Response = Response<B>, Error = ::Error> + 'static,
383381
B: Stream<Error=::Error> + 'static,
384382
B::Item: AsRef<[u8]>,
385383
{

0 commit comments

Comments
 (0)