Skip to content

Conversation

@tarcieri
Copy link
Member

This commit factors all of the associated constants off of the Integer trait into separate traits:

  • The existing Bounded trait subsumes BITS/BYTES
  • Constants provides ONE and MAX
  • LimbsConstant provides LIMBS

Methods have been added to Integer to query what was previously provided by the constants, allowing BoxedInteger to potentially impl the trait.

That isn't done yet though, because BoxedUint needs more trait impls first to meet the bounds of Integer.

This commit factors all of the associated constants off of the `Integer`
trait into separate traits:

- The existing `Bounded` trait subsumes `BITS`/`BYTES`
- `Constants` provides `ONE` and `MAX`
- `LimbsConstant` provides `LIMBS`

Methods have been added to `Integer` to query what was previously
provided by the constants, allowing `BoxedInteger` to potentially impl
the trait.

That isn't done yet though, because `BoxedUint` needs more trait impls
first to meet the bounds of `Integer`.
@tarcieri tarcieri merged commit c79ea4f into master Nov 30, 2023
@tarcieri tarcieri deleted the integer-trait-refactor branch November 30, 2023 01:09
@tarcieri tarcieri mentioned this pull request Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants