Skip to content

Commit

Permalink
Fix for weird type inference breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Jan 1, 2015
1 parent 69d92b8 commit 3c36bfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion phf/src/map.rs
Expand Up @@ -95,7 +95,8 @@ impl<K, V> Map<K, V> {
let (d1, d2) = self.disps[(g % (self.disps.len() as u32)) as uint];
let entry = &self.entries[(phf_shared::displace(f1, f2, d1, d2) % (self.entries.len() as u32))
as uint];
if BorrowFrom::borrow_from(&entry.0) == key {
let b: &T = BorrowFrom::borrow_from(&entry.0);
if b == key {
Some((&entry.0, &entry.1))
} else {
None
Expand Down
3 changes: 2 additions & 1 deletion phf/src/ordered_map.rs
Expand Up @@ -114,7 +114,8 @@ impl<K, V> OrderedMap<K, V> {
let idx = self.idxs[(phf_shared::displace(f1, f2, d1, d2) % (self.idxs.len() as u32)) as uint];
let entry = &self.entries[idx];

if BorrowFrom::borrow_from(&entry.0) == key {
let b: &T = BorrowFrom::borrow_from(&entry.0);
if b == key {
Some((idx, (&entry.0, &entry.1)))
} else {
None
Expand Down

0 comments on commit 3c36bfb

Please sign in to comment.