From 69288606bcf648967ddd09000f06e88161f80a2f Mon Sep 17 00:00:00 2001 From: Michal 'vorner' Vaner Date: Mon, 20 Jul 2020 19:27:14 +0200 Subject: [PATCH] Allow conversion from async client builder to blocking one (#978) The builders have mostly the same options and the blocking one is just a wrapper around the async one. The possible conversion makes it easier to support creating both kinds from configuration file, reducing some code duplication. --- src/blocking/client.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/blocking/client.rs b/src/blocking/client.rs index ebe1dbc..76595e0 100644 --- a/src/blocking/client.rs +++ b/src/blocking/client.rs @@ -545,6 +545,15 @@ impl ClientBuilder { } } +impl From for ClientBuilder { + fn from(builder: async_impl::ClientBuilder) -> Self { + Self { + inner: builder, + timeout: Timeout::default(), + } + } +} + impl Default for Client { fn default() -> Self { Self::new()