Skip to content

Commit

Permalink
Re-order impls for HttpsConnector
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Dec 11, 2023
1 parent 3883ec9 commit 281a1bc
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,6 @@ impl<T> HttpsConnector<T> {
}
}

impl<T> fmt::Debug for HttpsConnector<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("HttpsConnector")
.field("force_https", &self.force_https)
.finish()
}
}

impl<H, C> From<(H, C)> for HttpsConnector<H>
where
C: Into<Arc<rustls::ClientConfig>>,
{
fn from((http, cfg): (H, C)) -> Self {
Self {
force_https: false,
http,
tls_config: cfg.into(),
override_server_name: None,
}
}
}

impl<T> Service<Uri> for HttpsConnector<T>
where
T: Service<Uri>,
Expand Down Expand Up @@ -139,3 +117,25 @@ where
}
}
}

impl<H, C> From<(H, C)> for HttpsConnector<H>
where
C: Into<Arc<rustls::ClientConfig>>,
{
fn from((http, cfg): (H, C)) -> Self {
Self {
force_https: false,
http,
tls_config: cfg.into(),
override_server_name: None,
}
}
}

impl<T> fmt::Debug for HttpsConnector<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("HttpsConnector")
.field("force_https", &self.force_https)
.finish()
}
}

0 comments on commit 281a1bc

Please sign in to comment.