diff --git a/src/server/srv.rs b/src/server/srv.rs index 627f7a32f..e802e4ef0 100644 --- a/src/server/srv.rs +++ b/src/server/srv.rs @@ -177,8 +177,9 @@ impl HttpServer where H: IntoHttpHandler + 'static /// /// HttpServer does not change any configuration for TcpListener, /// it needs to be configured before passing it to listen() method. - pub fn listen(mut self, lst: net::TcpListener) { + pub fn listen(mut self, lst: net::TcpListener) -> Self { self.sockets.insert(lst.local_addr().unwrap(), lst); + self } /// The socket address to bind