Lint: fix unused Identity if only using default-tls (#1164)

This commit is contained in:
Sean McArthur
2021-02-08 14:25:09 -08:00
committed by GitHub
parent e56bd160ba
commit 287a6d1852
2 changed files with 15 additions and 6 deletions

View File

@@ -20,7 +20,9 @@ use super::response::Response;
use super::wait;
use crate::{async_impl, header, IntoUrl, Method, Proxy, redirect};
#[cfg(feature = "__tls")]
use crate::{Certificate, Identity};
use crate::Certificate;
#[cfg(any(feature = "native-tls", feature = "__rustls"))]
use crate::Identity;
/// A `Client` to make Requests with.
///
@@ -461,7 +463,12 @@ impl ClientBuilder {
}
/// Sets the identity to be used for client certificate authentication.
#[cfg(feature = "__tls")]
///
/// # Optional
///
/// This requires the optional `native-tls` or `rustls-tls(-...)` feature to be
/// enabled.
#[cfg(any(feature = "native-tls", feature = "__rustls"))]
pub fn identity(self, identity: Identity) -> ClientBuilder {
self.with_inner(move |inner| inner.identity(identity))
}