num-traits icon indicating copy to clipboard operation
num-traits copied to clipboard

`AsPrimInt` trait

Open benwh1 opened this issue 1 year ago • 0 comments

ToPrimitive implements conversions to all primitive numeric types, and provides to_T functions for each T, but AsPrimitive only implements a conversion to a single type, and there is currently no unifying trait that combines them all with as_T functions for each T. This change adds this trait, AsPrimInt, and automatically implements it on types that implement AsPrimitive<T> for all primitive integer types T.

benwh1 avatar May 19 '24 08:05 benwh1