Skip to content

Commit

Permalink
Merge pull request #98 from nihohit/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings that appear only with native-TLS.
  • Loading branch information
shachlanAmazon authored Jan 9, 2024
2 parents abdce8c + 0efbebb commit dd46efe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion redis/src/aio/async_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl RedisRuntime for AsyncStd {
hostname: &str,
socket_addr: SocketAddr,
insecure: bool,
tls_params: &Option<TlsConnParams>,
_tls_params: &Option<TlsConnParams>,
) -> RedisResult<Self> {
let tcp_stream = connect_tcp(&socket_addr).await?;
let tls_connector = if insecure {
Expand Down
3 changes: 0 additions & 3 deletions redis/src/cluster_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ use crate::{
};
use std::time::Duration;

#[cfg(not(feature = "tls-rustls"))]
use crate::connection::TlsConnParams;

#[cfg(all(not(feature = "tokio-comp"), feature = "async-std-comp"))]
use crate::aio::{async_std::AsyncStd, RedisRuntime};
use arcstr::ArcStr;
Expand Down
6 changes: 3 additions & 3 deletions redis/tests/support/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ impl RedisCluster {
cluster
}

// parameter `mtls_enabled` can only be used if `feature = tls-rustls` is active
// parameter `_mtls_enabled` can only be used if `feature = tls-rustls` is active
#[allow(dead_code)]
fn wait_for_replicas(&self, replicas: u16, mtls_enabled: bool) {
fn wait_for_replicas(&self, replicas: u16, _mtls_enabled: bool) {
'server: for server in &self.servers {
let conn_info = server.connection_info();
eprintln!(
Expand All @@ -280,7 +280,7 @@ impl RedisCluster {

#[cfg(feature = "tls-rustls")]
let client =
build_single_client(server.connection_info(), &self.tls_paths, mtls_enabled)
build_single_client(server.connection_info(), &self.tls_paths, _mtls_enabled)
.unwrap();
#[cfg(not(feature = "tls-rustls"))]
let client = redis::Client::open(server.connection_info()).unwrap();
Expand Down
1 change: 1 addition & 0 deletions redis/tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ mod util;
pub use self::util::*;

#[cfg(any(feature = "cluster", feature = "cluster-async"))]
#[allow(unused_imports)]
pub use self::cluster::*;

#[cfg(any(feature = "cluster", feature = "cluster-async"))]
Expand Down
6 changes: 3 additions & 3 deletions redis/tests/test_cluster_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ async fn do_failover(redis: &mut redis::aio::MultiplexedConnection) -> Result<()
Ok(())
}

// parameter `mtls_enabled` can only be used if `feature = tls-rustls` is active
// parameter `_mtls_enabled` can only be used if `feature = tls-rustls` is active
#[allow(dead_code)]
async fn test_failover(env: &TestClusterContext, requests: i32, value: i32, mtls_enabled: bool) {
async fn test_failover(env: &TestClusterContext, requests: i32, value: i32, _mtls_enabled: bool) {
let completed = Arc::new(AtomicI32::new(0));

let connection = env.async_connection().await;
Expand All @@ -310,7 +310,7 @@ async fn test_failover(env: &TestClusterContext, requests: i32, value: i32, mtls

#[cfg(feature = "tls-rustls")]
let client =
build_single_client(server.connection_info(), &server.tls_paths, mtls_enabled)
build_single_client(server.connection_info(), &server.tls_paths, _mtls_enabled)
.unwrap_or_else(|e| panic!("Failed to connect to '{addr}': {e}"));

#[cfg(not(feature = "tls-rustls"))]
Expand Down

0 comments on commit dd46efe

Please sign in to comment.