From 1eff89bd32d39c77a3e387734d5c9a4ea6582f6d Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 2 Aug 2023 15:31:45 +0200 Subject: [PATCH] Rename feature to rustls --- Cargo.toml | 3 ++- src/client.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a67ba8c..0146f21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,8 @@ description = "EPP client library for async Rust" repository = "https://github.com/InstantDomain/instant-epp" [features] -default = ["tokio-rustls"] +default = ["rustls"] +rustls = ["tokio-rustls"] [dependencies] async-trait = "0.1.52" diff --git a/src/client.rs b/src/client.rs index 82e6e4d..fa64efc 100644 --- a/src/client.rs +++ b/src/client.rs @@ -3,7 +3,7 @@ use std::time::Duration; use tracing::{debug, error}; use crate::common::NoExtension; -#[cfg(feature = "tokio-rustls")] +#[cfg(feature = "rustls")] use crate::common::{Certificate, PrivateKey}; pub use crate::connection::Connector; use crate::connection::EppConnection; @@ -29,7 +29,7 @@ use crate::xml; /// use instant_epp::domain::DomainCheck; /// use instant_epp::common::NoExtension; /// -/// # #[cfg(feature = "tokio-rustls")] +/// # #[cfg(feature = "rustls")] /// # #[tokio::main] /// # async fn main() { /// // Create an instance of EppClient @@ -54,7 +54,7 @@ use crate::xml; /// .for_each(|chk| println!("Domain: {}, Available: {}", chk.inner.id, chk.inner.available)); /// # } /// # -/// # #[cfg(not(feature = "tokio-rustls"))] +/// # #[cfg(not(feature = "rustls"))] /// # fn main() {} /// ``` /// @@ -68,7 +68,7 @@ pub struct EppClient { connection: EppConnection, } -#[cfg(feature = "tokio-rustls")] +#[cfg(feature = "rustls")] impl EppClient { /// Connect to the specified `addr` and `hostname` over TLS /// @@ -208,10 +208,10 @@ impl<'c, 'e, C, E> Clone for RequestData<'c, 'e, C, E> { // Manual impl because this does not depend on whether `C` and `E` are `Copy` impl<'c, 'e, C, E> Copy for RequestData<'c, 'e, C, E> {} -#[cfg(feature = "tokio-rustls")] +#[cfg(feature = "rustls")] use rustls_connector::RustlsConnector; -#[cfg(feature = "tokio-rustls")] +#[cfg(feature = "rustls")] mod rustls_connector { use std::io; use std::sync::Arc;