Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub trait HashBuilder<T> {
- fn build(key: T) -> usize;
- }
- impl HashBuilder<usize> for usize {
- fn build(key: usize) -> usize {
- key % 10
- }
- }
- impl HashBuilder<String> for String {
- fn build(key: String) -> usize {
- return 24 as usize; // neglect the return here, it's just a dummy code
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement