Skip to content

Commit

Permalink
Fix StreamId::contains_key signature
Browse files Browse the repository at this point in the history
Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
  • Loading branch information
Ayush1325 committed Feb 14, 2023
1 parent 0d0133c commit ffdcdcf
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 @@ -453,8 +453,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 @@ -146,9 +146,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 ffdcdcf

Please sign in to comment.