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
Detects when a type which implements Hash also implements both Borrow<str> and Borrow<[u8]>.
Advantage
It's impossible to implement both of these correctly, as str and [u8] hash differently in incompatible ways, and implementing Borrow<T> for your type guaratees that you hash equivalent to T.
This is worth adding because this impl is tempting to add, as the distinction between Borrow and AsRef is very subtle, and the AsRef impl for both is correct (as is implementing both for types which do not implement Hash).
See BurntSushi/bstr#168 for some discussion (As this would not quite have caught the problem in that issue, it's possible my formulation of it is too narrow. For the most part, I am chucking this lint proposal over the wall, and am not tied to the specifics here).