From 16e834d37cfa636f781dee3cb5bb456691fb789b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 22 Sep 2017 12:25:53 -0700 Subject: [PATCH] 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. --- src/server/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 26d7c335b0..6ab80458a3 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -96,8 +96,7 @@ impl + 'static> Http { /// The returned `Server` contains one method, `run`, which is used to /// actually run the server. pub fn bind(&self, addr: &SocketAddr, new_service: S) -> ::Result> - where S: NewService, Error = ::Error> + - Send + Sync + 'static, + where S: NewService, Error = ::Error> + 'static, Bd: Stream, { let core = try!(Core::new()); @@ -378,8 +377,7 @@ impl Service for HttpService } impl Server - where S: NewService, Error = ::Error> - + Send + Sync + 'static, + where S: NewService, Error = ::Error> + 'static, B: Stream + 'static, B::Item: AsRef<[u8]>, {