Releases: Techcable/primint.rs
Releases · Techcable/primint.rs
Release list
Only `NonZero`/`NonMax` aliases if those features have been enabled
Fixes
- Only define
NonZeroandNonMaxaliases if those features have been enabled (qwnmsrvm)- Fixes compilation errors present in v0.1.6
- Only run nonzero/nonmax tests if those features are enabled (pxvwytsn)
- Fix use of
BuildHasher::hash_onebreaking doctests before 1.71 (rpnulmvl)
Guarantee NonZero, NonMax have same Ord, Hash as underlying type
Make Hash impl for NonMax satisfy this property.
All other trait implementations already satisfied this.
Changed
- Officially guarantee that
NonMax<T>andNonZero<T>implementHashthe same asT(zoxoyvnx) - Similarly guarantee that
NonMax<T>andNonZero<T>implementOrdthe same asT(lzlwsrtp)- This has always been the case for both types.
Fixes
- The
Hashimpl forNonMaxnow behaves the same as the underlying typeT. (ppmqkvzx)- This property has always been true of
NonZero, but has not been true forNonMax
- This property has always been true of
Implement From impls for NonZero, NonMax
Added
- Add type aliases for
NonMaxandNonZero(i.e.NonZeroU32,NonMaxU32, etc.) (unqpkqks) - Add infallible
Fromconversions forNonMax,NonZero(xutqswvn)- No failable conversions yet, as that would require defining a
TryFromIntErrortype.
- No failable conversions yet, as that would require defining a
- Add
BITSassociated constant toNonMax,NonZero(rslwssvw) - Add
ONE,ZEROconstants toNonMaxandONEconstant toNonZero(mkyykwvx) - Require
PrimitiveIntto implement int format traits (Binary,LowerHex, etc.) (kkmsmlmr)- This was always true of the underlying integer types, but not required by the trait.
- Implement int format traits for
NonZero,NonMax(Binary,LowerHex, etc.) (mrlslmyw)- Always implemented by delegating to underlying type, just like stdlib and the
nonmaxcrate.
- Always implemented by delegating to underlying type, just like stdlib and the
Changes
- Delegate
Debugimpl forNonZero,NonMaxto underlying type (qnlmtkkx)- Makes behavior consistent with stdlib and
nonmaxcrate. - Previous behavior for
NonZerowas to format as newtype tuple struct (0formats asNonZero(0)] - Previous behavior for
NonMaxwas excessively verbose and exposed internal implementation details. - I don't consider this breaking since previous behavior was not guaranteed.
The new behavior is guaranteed unless the stdlib changes it behavior.
- Makes behavior consistent with stdlib and
Fixes
- Fix
Defaultimpl forNonMaxto return zero instead of one.
Make NonZero::new, NonMax::{new, get} a const fn
Added
- Implement
DisplayforNonZero,NonMax(svrxxntk) - Implement
BitOrforNonZero,BitAndforNonMax(rrlpzwum)
Changed
- Mark
NonZero::new,NonMax::{new, new_unchecked, get}asconst fn(vnvwkvzp)
Hide NonZero, NonMax behind on-by-default features.
Added
- Implement
DefaultforNonMax(wmvtkkqk)
Changed
- Hide
NonZero,NonMaxbehind on-by-default feature flags (nktrlykq) - Reduce MSRV from 1.71 back to 1.64 (rupzyqzu)
Fixed
- Restore compatibility with rust versions before 1.83 by avoiding
const_refs_to_cellfeature i(ssue #1) (nktrlykq)
Add NonZero and NonMax types, generic over PrimitiveInt
Added
- Add
wrapping_addandwrapping_subfunctions (wznskrrp) - Add
NonZerostruct to mirrorcore::num::NonZero, but made generic overPrimitiveInt(xooqvysu) - Add
NonMaxstruct to mirror theNonZerostruct (msuozwwt)- Offers alternative to the
nonmaxcrate. - Implemented in terms of
NonZerotype as stdlib doesn't offer it natively.
- Offers alternative to the
Changed
- Bump MSRV to 1.71
Add FromStr bound to PrimitiveInt
Added
- Add
core::str::FromStrbound toPrimitiveInt(xwvtvksx)
Fixed
- Remove dead link to nonexistent
PrimitiveIntegerin crate docs (xxxzxqpn)
The real trait name is actuallyPrimitiveInt.
Initial release
Includes all functionality needed by the intid.rs project.