From a7d12c8a0fb29eaa63bd4871a478ad2a773f5893 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 12 Oct 2021 18:01:24 +0200 Subject: [PATCH] fix super nit in ServerBuilder --- http-server/src/server.rs | 3 ++- ws-server/src/server.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/http-server/src/server.rs b/http-server/src/server.rs index 920b8d5808..8521c3f780 100644 --- a/http-server/src/server.rs +++ b/http-server/src/server.rs @@ -98,8 +98,9 @@ impl Builder { /// Configure a custom [`tokio::runtime::Handle`] to run the server on. /// /// Default: [`tokio::spawn`] - pub fn custom_tokio_runtime(mut self, rt: tokio::runtime::Handle) { + pub fn custom_tokio_runtime(mut self, rt: tokio::runtime::Handle) -> Self { self.tokio_runtime = Some(rt); + self } /// Finalizes the configuration of the server. diff --git a/ws-server/src/server.rs b/ws-server/src/server.rs index 8b96a857f0..8002533d7f 100644 --- a/ws-server/src/server.rs +++ b/ws-server/src/server.rs @@ -487,8 +487,9 @@ impl Builder { /// Configure a custom [`tokio::runtime::Handle`] to run the server on. /// /// Default: [`tokio::spawn`] - pub fn custom_tokio_runtime(mut self, rt: tokio::runtime::Handle) { + pub fn custom_tokio_runtime(mut self, rt: tokio::runtime::Handle) -> Self { self.settings.tokio_runtime = Some(rt); + self } /// Finalize the configuration of the server. Consumes the [`Builder`].