Summary
LinkReference should include num_traits::WrappingAdd (and potentially other wrapping arithmetic traits) in its supertraits.
Motivation
After removing the LinkType trait from platform-data (linksplatform/data-rs#16), all bounds that were on LinkType need to come from LinkReference directly. The WrappingAdd trait is needed for wrapping unsigned arithmetic in Hybrid (used for internal/external link reference encoding).
Currently, platform-data must add num-traits as an explicit dependency and add + WrappingAdd bounds alongside every LinkReference bound. If LinkReference included WrappingAdd, downstream crates could use T: LinkReference without additional trait bounds.
Proposed change
Add WrappingAdd (from num-traits) to the LinkReference trait definition:
pub trait LinkReference:
// ... existing bounds ...
+ WrappingAdd
{}
Since WrappingAdd is implemented for all unsigned primitive integer types (the same types LinkReference is implemented for), this is a compatible addition.
Context
Summary
LinkReferenceshould includenum_traits::WrappingAdd(and potentially other wrapping arithmetic traits) in its supertraits.Motivation
After removing the
LinkTypetrait fromplatform-data(linksplatform/data-rs#16), all bounds that were onLinkTypeneed to come fromLinkReferencedirectly. TheWrappingAddtrait is needed for wrapping unsigned arithmetic inHybrid(used for internal/external link reference encoding).Currently,
platform-datamust addnum-traitsas an explicit dependency and add+ WrappingAddbounds alongside everyLinkReferencebound. IfLinkReferenceincludedWrappingAdd, downstream crates could useT: LinkReferencewithout additional trait bounds.Proposed change
Add
WrappingAdd(fromnum-traits) to theLinkReferencetrait definition:Since
WrappingAddis implemented for all unsigned primitive integer types (the same typesLinkReferenceis implemented for), this is a compatible addition.Context