Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. pub trait Hash {
  2. fn hash(&self) -> usize;
  3. }
  4. impl Hash for usize {
  5. fn hash(&self) -> usize {
  6. *self % 10
  7. }
  8. }
  9. impl Hash for String {
  10. fn hash(&self) -> usize {
  11. self.len() % 24
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement