diff --git a/src/server/conn/auto.rs b/src/server/conn/auto.rs index fa5337a..1a2f7f8 100644 --- a/src/server/conn/auto.rs +++ b/src/server/conn/auto.rs @@ -522,7 +522,7 @@ impl Http1Builder<'_, E> { } /// Bind a connection together with a [`Service`]. - pub async fn serve_connection(&self, io: I, service: S) -> Result<()> + pub fn serve_connection(&self, io: I, service: S) -> Connection where S: Service, Response = Response>, S::Future: 'static, @@ -532,7 +532,7 @@ impl Http1Builder<'_, E> { I: Read + Write + Unpin + 'static, E: Http2ServerConnExec, { - self.inner.serve_connection(io, service).await + self.inner.serve_connection(io, service) } } @@ -667,7 +667,7 @@ impl Http2Builder<'_, E> { } /// Bind a connection together with a [`Service`]. - pub async fn serve_connection(&self, io: I, service: S) -> Result<()> + pub async fn serve_connection(&self, io: I, service: S) -> Connection where S: Service, Response = Response>, S::Future: 'static, @@ -677,7 +677,7 @@ impl Http2Builder<'_, E> { I: Read + Write + Unpin + 'static, E: Http2ServerConnExec, { - self.inner.serve_connection(io, service).await + self.inner.serve_connection(io, service) } }