Releases: coriolinus/counter-rs
Documentation
- Add module documentation from README
- Make all doctests pass
- Update README from module documentation
- Add inline doctest examples for most methods
- remove
N: Clone
mandatory bound
into_map method
This method simply converts the Counter
into its internal HashMap
, for times when the use of a Counter
is an implementation detail.
Parameterized numeric type
This is a breaking change which adds a second type parameter to Counter, which is used to actually store the count. Some existing code may fail due to the new required parameter. In particular, type discovery appears not to be able to correctly determine that N should be usize by default when creating a counter via init.
`most_common` fix
Increment the minor version because this is another breaking change. We now simply return a Vec<(T, usize)>
from the most_common*
functions instead of an iterator over said vector.
Iterable Math
- Implement
AddAssign<I>, Add<I>, SubAssign<I>, Sub<I> for Counter where I: IntoIterator<Item=T>
. - Implement
AddAssign, SubAssign for Counter
. - Improve documentation.
Dereferable
Changed the interface: instead of needing to call .map
on Counter
objects, they now implement Deref
and DerefMut
, so all relevant methods can be called on them directly.
Version 0.1.0
Initial release. Some API features, notably the most_common*
functions, have inefficient implementations; this will be addressed in future versions.