mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-11-25 01:16:12 +02:00
Remove redundant trait bounds from counter exercise (#1980)
The trait bounds aren't needed on the struct definition, only the impl block. I think it'd be useful to show the difference here in order to show students how trait bounds for collection types are usually on the impl blocks rather than the type itself.
This commit is contained in:
parent
b808887006
commit
a4d674b02e
@ -18,7 +18,7 @@ use std::collections::HashMap;
|
||||
use std::hash::Hash;
|
||||
|
||||
/// Counter counts the number of times each value of type T has been seen.
|
||||
struct Counter<T: Eq + Hash> {
|
||||
struct Counter<T> {
|
||||
values: HashMap<T, u64>,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user