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.
This commit is contained in:
Michal 'vorner' Vaner
2020-07-20 19:27:14 +02:00
committed by GitHub
parent a800202384
commit 69288606bc

View File

@@ -545,6 +545,15 @@ impl ClientBuilder {
}
}
impl From<async_impl::ClientBuilder> for ClientBuilder {
fn from(builder: async_impl::ClientBuilder) -> Self {
Self {
inner: builder,
timeout: Timeout::default(),
}
}
}
impl Default for Client {
fn default() -> Self {
Self::new()