From 80ba8cc15066c2a6d35d68b058e795be5e01cd94 Mon Sep 17 00:00:00 2001 From: Rodolfo P A Date: Thu, 21 Nov 2019 16:52:17 -0300 Subject: [PATCH] Implement Default for Client, ClientBuilder and Form (#712) --- src/async_impl/client.rs | 12 ++++++++++++ src/async_impl/multipart.rs | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index 092d30c..b4d615e 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -86,6 +86,12 @@ struct Config { cookie_store: Option, } +impl Default for ClientBuilder { + fn default() -> Self { + Self::new() + } +} + impl ClientBuilder { /// Constructs a new `ClientBuilder`. /// @@ -601,6 +607,12 @@ impl ClientBuilder { type HyperClient = hyper::Client; +impl Default for Client { + fn default() -> Self { + Self::new() + } +} + impl Client { /// Constructs a new `Client`. /// diff --git a/src/async_impl/multipart.rs b/src/async_impl/multipart.rs index 4527f41..25a64e1 100644 --- a/src/async_impl/multipart.rs +++ b/src/async_impl/multipart.rs @@ -44,6 +44,12 @@ pub(crate) trait PartProps { // ===== impl Form ===== +impl Default for Form { + fn default() -> Self { + Self::new() + } +} + impl Form { /// Creates a new async Form without any content. pub fn new() -> Form {