Skip to content

Commit 938a1ee

Browse files
author
Adar Ovadia
committed
remove unessecrry az return type
Signed-off-by: Adar Ovadia <adarov@amazon.com>
1 parent 7702069 commit 938a1ee

File tree

5 files changed

+22
-37
lines changed

5 files changed

+22
-37
lines changed

glide-core/redis-rs/redis/src/aio/connection.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,13 @@ where
411411
pub(crate) async fn connect_simple<T: RedisRuntime>(
412412
connection_info: &ConnectionInfo,
413413
_socket_addr: Option<SocketAddr>,
414-
) -> RedisResult<(T, Option<IpAddr>, Option<String>)> {
414+
) -> RedisResult<(T, Option<IpAddr>)> {
415415
Ok(match connection_info.addr {
416416
ConnectionAddr::Tcp(ref host, port) => {
417417
if let Some(socket_addr) = _socket_addr {
418418
return Ok::<_, RedisError>((
419419
<T>::connect_tcp(socket_addr).await?,
420420
Some(socket_addr.ip()),
421-
None,
422421
));
423422
}
424423
let socket_addrs = get_socket_addrs(host, port).await?;
@@ -428,7 +427,6 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
428427
Ok::<_, RedisError>((
429428
<T>::connect_tcp(socket_addr).await?,
430429
Some(socket_addr.ip()),
431-
None,
432430
))
433431
})
434432
}))
@@ -447,7 +445,6 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
447445
return Ok::<_, RedisError>((
448446
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
449447
Some(socket_addr.ip()),
450-
None,
451448
));
452449
}
453450
let socket_addrs = get_socket_addrs(host, port).await?;
@@ -461,7 +458,6 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
461458
Ok::<_, RedisError>((
462459
<T>::connect_tcp_tls(host, socket_addr, insecure, tls_params).await?,
463460
Some(socket_addr.ip()),
464-
None,
465461
))
466462
})
467463
}))
@@ -480,7 +476,7 @@ pub(crate) async fn connect_simple<T: RedisRuntime>(
480476
#[cfg(unix)]
481477
ConnectionAddr::Unix(ref path) => {
482478
log_conn_creation("UDS", path, None);
483-
(<T>::connect_unix(path).await?, None, None)
479+
(<T>::connect_unix(path).await?, None)
484480
}
485481

486482
#[cfg(not(unix))]

glide-core/redis-rs/redis/src/client.rs

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Client {
105105
&self,
106106
_push_sender: Option<mpsc::UnboundedSender<PushInfo>>,
107107
) -> RedisResult<crate::aio::Connection> {
108-
let (con, _ip, _az) = match Runtime::locate() {
108+
let (con, _ip) = match Runtime::locate() {
109109
#[cfg(feature = "tokio-comp")]
110110
Runtime::Tokio => {
111111
self.get_simple_async_connection::<crate::aio::tokio::Tokio>(None)
@@ -160,21 +160,17 @@ impl Client {
160160
Ok(Err(e)) => Err(e),
161161
Err(elapsed) => Err(elapsed.into()),
162162
}
163-
.map(|(conn, _ip, _az)| conn)
163+
.map(|(conn, _ip)| conn)
164164
}
165165

166-
/// For TCP connections: returns (async connection, Some(the direct IP address, Some(az)))
167-
/// For Unix connections, returns (async connection, None, None)
166+
/// For TCP connections: returns (async connection, Some(the direct IP address))
167+
/// For Unix connections, returns (async connection, None)
168168
#[cfg(feature = "tokio-comp")]
169169
#[cfg_attr(docsrs, doc(cfg(feature = "tokio-comp")))]
170-
pub async fn get_multiplexed_async_connection_ip_and_az(
170+
pub async fn get_multiplexed_async_connection_ip(
171171
&self,
172172
glide_connection_options: GlideConnectionOptions,
173-
) -> RedisResult<(
174-
crate::aio::MultiplexedConnection,
175-
Option<IpAddr>,
176-
Option<String>,
177-
)> {
173+
) -> RedisResult<(crate::aio::MultiplexedConnection, Option<IpAddr>)> {
178174
match Runtime::locate() {
179175
#[cfg(feature = "tokio-comp")]
180176
Runtime::Tokio => {
@@ -212,7 +208,7 @@ impl Client {
212208
.await;
213209

214210
match result {
215-
Ok(Ok((connection, _ip, _az))) => Ok(connection),
211+
Ok(Ok((connection, _ip))) => Ok(connection),
216212
Ok(Err(e)) => Err(e),
217213
Err(elapsed) => Err(elapsed.into()),
218214
}
@@ -396,23 +392,19 @@ impl Client {
396392
response_timeout: std::time::Duration,
397393
socket_addr: Option<SocketAddr>,
398394
glide_connection_options: GlideConnectionOptions,
399-
) -> RedisResult<(
400-
crate::aio::MultiplexedConnection,
401-
Option<IpAddr>,
402-
Option<String>,
403-
)>
395+
) -> RedisResult<(crate::aio::MultiplexedConnection, Option<IpAddr>)>
404396
where
405397
T: crate::aio::RedisRuntime,
406398
{
407-
let (connection, driver, ip, az) = self
399+
let (connection, driver, ip) = self
408400
.create_multiplexed_async_connection_inner::<T>(
409401
response_timeout,
410402
socket_addr,
411403
glide_connection_options,
412404
)
413405
.await?;
414406
T::spawn(driver);
415-
Ok((connection, ip, az))
407+
Ok((connection, ip))
416408
}
417409

418410
async fn create_multiplexed_async_connection_inner<T>(
@@ -424,20 +416,19 @@ impl Client {
424416
crate::aio::MultiplexedConnection,
425417
impl std::future::Future<Output = ()>,
426418
Option<IpAddr>,
427-
Option<String>,
428419
)>
429420
where
430421
T: crate::aio::RedisRuntime,
431422
{
432-
let (con, ip, az) = self.get_simple_async_connection::<T>(socket_addr).await?;
423+
let (con, ip) = self.get_simple_async_connection::<T>(socket_addr).await?;
433424
crate::aio::MultiplexedConnection::new_with_response_timeout(
434425
&self.connection_info,
435426
con,
436427
response_timeout,
437428
glide_connection_options,
438429
)
439430
.await
440-
.map(|res| (res.0, res.1, ip, az))
431+
.map(|res| (res.0, res.1, ip))
441432
}
442433

443434
async fn get_simple_async_connection<T>(
@@ -446,14 +437,13 @@ impl Client {
446437
) -> RedisResult<(
447438
Pin<Box<dyn crate::aio::AsyncStream + Send + Sync>>,
448439
Option<IpAddr>,
449-
Option<String>,
450440
)>
451441
where
452442
T: crate::aio::RedisRuntime,
453443
{
454-
let (conn, ip, az) =
444+
let (conn, ip) =
455445
crate::aio::connect_simple::<T>(&self.connection_info, socket_addr).await?;
456-
Ok((conn.boxed(), ip, az))
446+
Ok((conn.boxed(), ip))
457447
}
458448

459449
#[cfg(feature = "connection-manager")]

glide-core/redis-rs/redis/src/cluster_async/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2843,7 +2843,7 @@ pub trait Connect: Sized {
28432843
connection_timeout: Duration,
28442844
socket_addr: Option<SocketAddr>,
28452845
glide_connection_options: GlideConnectionOptions,
2846-
) -> RedisFuture<'a, (Self, Option<IpAddr>, Option<String>)>
2846+
) -> RedisFuture<'a, (Self, Option<IpAddr>)>
28472847
where
28482848
T: IntoConnectionInfo + Send + 'a;
28492849
}
@@ -2855,7 +2855,7 @@ impl Connect for MultiplexedConnection {
28552855
connection_timeout: Duration,
28562856
socket_addr: Option<SocketAddr>,
28572857
glide_connection_options: GlideConnectionOptions,
2858-
) -> RedisFuture<'a, (MultiplexedConnection, Option<IpAddr>, Option<String>)>
2858+
) -> RedisFuture<'a, (MultiplexedConnection, Option<IpAddr>)>
28592859
where
28602860
T: IntoConnectionInfo + Send + 'a,
28612861
{

glide-core/redis-rs/redis/tests/support/mock_cluster.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl cluster_async::Connect for MockConnection {
133133
_connection_timeout: Duration,
134134
_socket_addr: Option<SocketAddr>,
135135
_glide_connection_options: GlideConnectionOptions,
136-
) -> RedisFuture<'a, (Self, Option<IpAddr>, Option<String>)>
136+
) -> RedisFuture<'a, (Self, Option<IpAddr>)>
137137
where
138138
T: IntoConnectionInfo + Send + 'a,
139139
{
@@ -180,7 +180,6 @@ impl cluster_async::Connect for MockConnection {
180180
port,
181181
},
182182
ip,
183-
None,
184183
)))
185184
}
186185
}

glide-core/redis-rs/redis/tests/test_cluster_async.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,20 +724,20 @@ mod cluster_async {
724724
connection_timeout: std::time::Duration,
725725
socket_addr: Option<SocketAddr>,
726726
glide_connection_options: GlideConnectionOptions,
727-
) -> RedisFuture<'a, (Self, Option<IpAddr>, Option<String>)>
727+
) -> RedisFuture<'a, (Self, Option<IpAddr>)>
728728
where
729729
T: IntoConnectionInfo + Send + 'a,
730730
{
731731
Box::pin(async move {
732-
let (inner, _ip, _az) = MultiplexedConnection::connect(
732+
let (inner, _ip) = MultiplexedConnection::connect(
733733
info,
734734
response_timeout,
735735
connection_timeout,
736736
socket_addr,
737737
glide_connection_options,
738738
)
739739
.await?;
740-
Ok((ErrorConnection { inner }, None, None))
740+
Ok((ErrorConnection { inner }, None))
741741
})
742742
}
743743
}

0 commit comments

Comments
 (0)