- Error[E0277]: the trait bound St: BuildHasher is not satisfied
- Extend release docs to include github release
- Upgrade dependencies
- Get trait bounds out of struct definition
- Add support for custom hashers
- Use a more modern ci config
- Try again to improve ci
- Default branch is
masterin this repo - Add changelog generation pre-release hook
- Fix
cargo clippy
- update edition, add
counterkeyword - refactor tests and impls into distinct modules
- small doc formatting
- deprecate
initmethod - do not use deprecated
initmethod - With capacity
- Clippy fixes
- Implement Serialize and Deserialize
- Implement is_subset and is_superset tests
- Implement bitwise and and or assignments
- Fix spelling error in doc header
- Multiset bag documentation
- Relax more trait bounds
- Improve concision
- Fix minor issues in documentation
- Add method to return the
kmost common items and speed upmost_common_*()methods
- Add method
Counter::total() - Relax trait bounds
- Relax trait bounds for
Defaultimplementation
N: Clonebound is not required on {Add,Sub}{,Assign}
Implementing these traits gives users more ways to usefully combine their counts.
- Remove unnecessary cloning
Counters now implement Index and IndexMut, so they can have implicit zero counts. In other words:
let counter = "aaa".chars().collect::<Counter<_>>();
assert_eq!(counter[&'b'], 0);
// panics
// assert_eq!((*counter)[&'b'], 0);This is a breaking change, causing a minor version bump, because it is not impossible that previous code depended on indexing panicing for unknown entries. Code which does not panic as part of its intended control flow will not be affected.
All Copy types are also Clone types where the clone bound happens to be really cheap. Bounding N: Clone instead of N: Copy means that we can use numeric types like num::BigInteger, which are not Copy, and things still work. You pay a bit more runtime cost, but if you're using a non-default counter type, presumably you know the costs of your actions.