From 3c36bfbdd6ebfc1e544cbd38473f48e91406d965 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 31 Dec 2014 21:23:35 -0800 Subject: [PATCH] Fix for weird type inference breakage --- phf/src/map.rs | 3 ++- phf/src/ordered_map.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phf/src/map.rs b/phf/src/map.rs index b32a35e4..a1be50ba 100644 --- a/phf/src/map.rs +++ b/phf/src/map.rs @@ -95,7 +95,8 @@ impl Map { 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 diff --git a/phf/src/ordered_map.rs b/phf/src/ordered_map.rs index b2793346..6a0ee521 100644 --- a/phf/src/ordered_map.rs +++ b/phf/src/ordered_map.rs @@ -114,7 +114,8 @@ impl OrderedMap { 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