Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub trait HashBuilder<T> {
- fn build(key: T) -> usize;
- }
- struct HashMap<K, V> {
- key: K,
- value: V
- }
- impl<K, V> HashBuilder<K> for HashMap<K, V> {
- fn build(key: K) -> usize {
- // Some Implementation that changes, respective to the way HashMap key: type is
- // defined...
- return 23 as usize;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement