Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3.0 #17

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
# Changelog

## v0.3.0 (2024-02-04)

**Major Changes**

* Changes the return type of `CountDigits::count_digits()` from `u32` to `usize`.
* Changes the return type of `CountDigits::count_digits_radix()` from `u32` to `usize`.
* Implements `CountDigits` for references to types that implement `CountDigits`.

**Adds**

* Adds new tests for reference types.

The rationale behind changing the return types listed above is that bit-related functions
typically return `u32` and take `u32` as parameters, but `usize` is often used for formatting
and display.

In this way, the inherently bit-related functions, `count_bits()`,
`count_octal_digits()`, and `count_hex_digits()` continue to return `u32` and can be used
with the `BITS` constants as well as bit-shifting functions without the need to cast.

Likewise, the `count_digits()` function as well as the `count_digits_radix()` function can be used
as arguments for formatting without the need to cast.

I believe this provides the best compromise,
allowing the trait to be used smoothly across various use cases without the `as` keyword.

## v0.2.6 (2024-01-31)

**Changes**

* Include only the files necessary to build the crate for publishing in the Cargo.toml.
* Includes only the files necessary to build the crate for publishing in the Cargo.toml.

## v0.2.5 (2024-01-31)

Expand Down Expand Up @@ -74,6 +100,9 @@ The v0.2.5 `count_octal_digits` and `count_hex_digits` are now implemented inter

## v0.2.0 (2024-01-24)

**Major Changes**
* Adds new trait functions to `CountDigits`, listed below.

**Adds**

* Adds `CountDigits::count_bits()`.
Expand All @@ -86,10 +115,9 @@ The v0.2.5 `count_octal_digits` and `count_hex_digits` are now implemented inter
* Implements the above functions for unsigned, non-zero integer types.
* Bumps the minimum supported Rust version `(1.67.1 -> 1.71.1)` due to using `is_negative()` for non-zero integer types.

**Changes**

* Refactors min_and_max tests.
**Minor Changes**
* Refactors iteration tests.
* Refactors min_and_max tests.

## v0.1.0 (2024-01-22)
> Initial Release
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "count-digits"
version = "0.2.6"
version = "0.3.0"
authors = ["Erik Nordin <[email protected]>"]
description = "A no-std trait to count the digits of integer types in various number bases."
homepage = "https://github.com/nordzilla/count-digits"
Expand Down
Loading
Loading