Skip to content

Commit

Permalink
Fix StreamId::contains_key signature (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush1325 committed Dec 2, 2023
1 parent 413f4d9 commit db19291
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions redis/src/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ impl StreamId {
}

/// Does the message contain a particular field?
pub fn contains_key(&self, key: &&str) -> bool {
self.map.get(*key).is_some()
pub fn contains_key(&self, key: &str) -> bool {
self.map.get(key).is_some()
}

/// Returns how many field/value pairs exist in this message.
Expand Down
6 changes: 3 additions & 3 deletions redis/tests/test_streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ fn test_assorted_1() {
let _: RedisResult<String> = con.xadd_map("k3", "3000-0", map);

let reply: StreamRangeReply = con.xrange_all("k3").unwrap();
assert!(reply.ids[0].contains_key(&"ab"));
assert!(reply.ids[0].contains_key(&"ef"));
assert!(reply.ids[0].contains_key(&"ij"));
assert!(reply.ids[0].contains_key("ab"));
assert!(reply.ids[0].contains_key("ef"));
assert!(reply.ids[0].contains_key("ij"));

// test xadd w/ maxlength below...

Expand Down

0 comments on commit db19291

Please sign in to comment.