cargo fmt

This commit is contained in:
Martin Algesten
2021-12-19 20:59:06 +01:00
parent 75f6be8ff8
commit 8f476e9d29
2 changed files with 3 additions and 6 deletions

View File

@@ -139,7 +139,7 @@ impl Transport {
/// // classification
/// assert_eq!(error.kind(), ErrorKind::InvalidUrl);
/// assert_eq!(error.kind().to_string(), "Bad URL");
///
///
/// // higher level message
/// assert_eq!(error.message(), Some("failed to parse URL: RelativeUrlWithoutBase"));
///

View File

@@ -95,11 +95,8 @@ impl TlsConnector for Arc<rustls::ClientConfig> {
dns_name: &str,
mut tcp_stream: TcpStream,
) -> Result<Box<dyn HttpsStream>, Error> {
let sni = rustls::ServerName::try_from(dns_name).map_err(|e| {
ErrorKind::Dns
.msg(format!("parsing '{}'", dns_name))
.src(e)
})?;
let sni = rustls::ServerName::try_from(dns_name)
.map_err(|e| ErrorKind::Dns.msg(format!("parsing '{}'", dns_name)).src(e))?;
let mut sess = rustls::ClientConnection::new(self.clone(), sni)
.map_err(|e| ErrorKind::Io.msg("tls connection creation failed").src(e))?;