Simple object to count Rust iterables
This method simply converts the Counter
into its internal HashMap
, for times when the use of a Counter
is an implementation detail.
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.
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.
AddAssign<I>, Add<I>, SubAssign<I>, Sub<I> for Counter where I: IntoIterator<Item=T>
.AddAssign, SubAssign for Counter
.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.
Initial release. Some API features, notably the most_common*
functions, have inefficient implementations; this will be addressed in future versions.