Skip to content

Releases: coriolinus/counter-rs

v0.6.0

30 Jun 11:25
01637a6
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.7...v0.5.8

v0.5.7: Counters are Multisets

12 Oct 14:05
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.6...v0.5.7

v0.5.6: `k_most_common_items` and more relaxed trait bounds

16 Jul 10:42
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.5.5...v0.5.6

v0.5.5: Relax trait bounds, add `.total()` method

05 May 20:08
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.4...v0.5.5

v0.5.4: Relax trait bounds for `Default`

02 Apr 17:44
Compare
Choose a tag to compare

What's Changed

  • Relax trait bounds for Default implementation by @jonasbb in #19

New Contributors

Full Changelog: v0.5.3...v0.5.4

more iterators and relax trait bounds

07 Feb 16:07
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.2...v0.5.3

impl Extend, IntoIterator for Counter

23 Jun 12:22
Compare
Choose a tag to compare

Implementing these traits gives users more ways to usefully combine their counts.

Remove unnecessary cloning

19 May 11:19
f7f7b71
Compare
Choose a tag to compare

This release removes self-cloning from the Add, Sub, and BitOr impls.
This also fixes a number of other clippy, minor clippy lints.

Implicit zero for unknown entries

19 May 09:03
Compare
Choose a tag to compare

Counters now implement Index and IndexMut, so they can have implicit zero counts. In other words:

# use counter::Counter;
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.

Bound N on Clone, not Copy

08 Aug 08:41
3d9f65b
Compare
Choose a tag to compare

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.