From 006c8bbd4fd8ec140a84925006cbf13f8f97af72 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 18 Sep 2024 10:35:10 +0200 Subject: [PATCH] Fix warning from redis crate. You can read about the warning here: https://github.com/redis-rs/redis-rs/issues/1228 Essentially, the functions in question are subject to a subtle change that will be coming in Rust 2024. To get ahead of this change, a warning is now produced in Rust 1.81. The fix is small even if it's unfortunately a bit awkward. Signed-off-by: Ryan Levick --- crates/factor-outbound-redis/src/host.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/factor-outbound-redis/src/host.rs b/crates/factor-outbound-redis/src/host.rs index baf3bb3c91..a2d21d9ba5 100644 --- a/crates/factor-outbound-redis/src/host.rs +++ b/crates/factor-outbound-redis/src/host.rs @@ -74,7 +74,10 @@ impl v2::HostConnection for crate::InstanceState { payload: Vec, ) -> Result<(), Error> { let conn = self.get_conn(connection).await.map_err(other_error)?; - conn.publish(&channel, &payload) + // The `let () =` syntax is needed to suppress a warning when the result type is inferred. + // You can read more about the issue here: + let () = conn + .publish(&channel, &payload) .await .map_err(other_error)?; Ok(()) @@ -99,7 +102,9 @@ impl v2::HostConnection for crate::InstanceState { value: Vec, ) -> Result<(), Error> { let conn = self.get_conn(connection).await.map_err(other_error)?; - conn.set(&key, &value).await.map_err(other_error)?; + // The `let () =` syntax is needed to suppress a warning when the result type is inferred. + // You can read more about the issue here: + let () = conn.set(&key, &value).await.map_err(other_error)?; Ok(()) }