Skip to content

Commit

Permalink
refactor: enable doc_auto_cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
omjadas committed Dec 21, 2024
1 parent 1c3681e commit cf3e0ee
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/certificate_authority/openssl_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ use tracing::debug;
/// aws_lc_rs::default_provider(),
/// );
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "openssl-ca")))]
pub struct OpensslAuthority {
pkey: PKey<Private>,
private_key: PrivateKeyDer<'static>,
Expand Down
1 change: 0 additions & 1 deletion src/certificate_authority/rcgen_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use tracing::debug;
///
/// let ca = RcgenAuthority::new(key_pair, ca_cert, 1_000, aws_lc_rs::default_provider());
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "rcgen-ca")))]
pub struct RcgenAuthority {
key_pair: KeyPair,
ca_cert: Certificate,
Expand Down
2 changes: 0 additions & 2 deletions src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ fn decode_body<'a>(
/// }
/// }
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "decoder")))]
pub fn decode_request(mut req: Request<Body>) -> Result<Request<Body>, Error> {
if !req.headers().contains_key(CONTENT_ENCODING) {
return Ok(req);
Expand Down Expand Up @@ -182,7 +181,6 @@ pub fn decode_request(mut req: Request<Body>) -> Result<Request<Body>, Error> {
/// }
/// }
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "decoder")))]
pub fn decode_response(mut res: Response<Body>) -> Result<Response<Body>, Error> {
if !res.headers().contains_key(CONTENT_ENCODING) {
return Ok(res);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

//! Hudsucker is a MITM HTTP/S proxy that allows you to:
//!
Expand Down
11 changes: 3 additions & 8 deletions src/proxy/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ use crate::{
WebSocketHandler,
};
use hyper_util::{
client::legacy::{
connect::{Connect, HttpConnector},
Client,
},
client::legacy::{connect::Connect, Client},
rt::TokioExecutor,
server::conn::auto::Builder,
};
Expand All @@ -24,11 +21,9 @@ use tokio_tungstenite::Connector;
#[non_exhaustive]
pub enum Error {
#[cfg(feature = "native-tls-client")]
#[cfg_attr(docsrs, doc(cfg(feature = "native-tls-client")))]
#[error("{0}")]
NativeTls(#[from] hyper_tls::native_tls::Error),
#[cfg(feature = "rustls-client")]
#[cfg_attr(docsrs, doc(cfg(feature = "rustls-client")))]
#[error("{0}")]
Rustls(#[from] tokio_rustls::rustls::Error),
}
Expand Down Expand Up @@ -130,7 +125,6 @@ pub struct WantsClient<CA> {
impl<CA> ProxyBuilder<WantsClient<CA>> {
/// Use a hyper-rustls connector.
#[cfg(feature = "rustls-client")]
#[cfg_attr(docsrs, doc(cfg(feature = "rustls-client")))]
pub fn with_rustls_client(
self,
provider: CryptoProvider,
Expand Down Expand Up @@ -183,11 +177,12 @@ impl<CA> ProxyBuilder<WantsClient<CA>> {

/// Use a hyper-tls connector.
#[cfg(feature = "native-tls-client")]
#[cfg_attr(docsrs, doc(cfg(feature = "native-tls-client")))]
pub fn with_native_tls_client(
self,
) -> ProxyBuilder<WantsHandlers<CA, impl Connect + Clone, NoopHandler, NoopHandler, Pending<()>>>
{
use hyper_util::client::legacy::connect::HttpConnector;

let tls_connector = match hyper_tls::native_tls::TlsConnector::new() {
Ok(tls_connector) => tls_connector,
Err(e) => {
Expand Down

0 comments on commit cf3e0ee

Please sign in to comment.