You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use bstr;#[test]fntest_bstr(){letmut m = HashMap::new();
m.insert("hello".to_owned(),42i8);assert!(m.get(bstr::BStr::new("hello")).copied() == Some(42));}
We expect it to pass, but failed. The root cause is: the hash for identical content differs between a String and bytes.
Considering Borrow's requirement:
In particular Eq, Ord and Hash must be equivalent for borrowed and owned values: x.borrow() == y.borrow() should give the same result as x == y.