Skip to content

Commit 006c8bb

Browse files
committed
Fix warning from redis crate.
You can read about the warning here: redis-rs/redis-rs#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 <[email protected]>
1 parent 90a2adb commit 006c8bb

File tree

1 file changed

+7
-2
lines changed
  • crates/factor-outbound-redis/src

1 file changed

+7
-2
lines changed

crates/factor-outbound-redis/src/host.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ impl v2::HostConnection for crate::InstanceState {
7474
payload: Vec<u8>,
7575
) -> Result<(), Error> {
7676
let conn = self.get_conn(connection).await.map_err(other_error)?;
77-
conn.publish(&channel, &payload)
77+
// The `let () =` syntax is needed to suppress a warning when the result type is inferred.
78+
// You can read more about the issue here: <https://github.com/redis-rs/redis-rs/issues/1228>
79+
let () = conn
80+
.publish(&channel, &payload)
7881
.await
7982
.map_err(other_error)?;
8083
Ok(())
@@ -99,7 +102,9 @@ impl v2::HostConnection for crate::InstanceState {
99102
value: Vec<u8>,
100103
) -> Result<(), Error> {
101104
let conn = self.get_conn(connection).await.map_err(other_error)?;
102-
conn.set(&key, &value).await.map_err(other_error)?;
105+
// The `let () =` syntax is needed to suppress a warning when the result type is inferred.
106+
// You can read more about the issue here: <https://github.com/redis-rs/redis-rs/issues/1228>
107+
let () = conn.set(&key, &value).await.map_err(other_error)?;
103108
Ok(())
104109
}
105110

0 commit comments

Comments
 (0)