Skip to content

Commit

Permalink
Fix warning from redis crate.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rylev committed Sep 18, 2024
1 parent 90a2adb commit 006c8bb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/factor-outbound-redis/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ impl v2::HostConnection for crate::InstanceState {
payload: Vec<u8>,
) -> 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: <https://github.com/redis-rs/redis-rs/issues/1228>
let () = conn
.publish(&channel, &payload)
.await
.map_err(other_error)?;
Ok(())
Expand All @@ -99,7 +102,9 @@ impl v2::HostConnection for crate::InstanceState {
value: Vec<u8>,
) -> 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: <https://github.com/redis-rs/redis-rs/issues/1228>
let () = conn.set(&key, &value).await.map_err(other_error)?;
Ok(())
}

Expand Down

0 comments on commit 006c8bb

Please sign in to comment.