Skip to content

Commit

Permalink
Add trait impl check for signed ints
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Jun 28, 2023
1 parent a5ae44a commit 8d89684
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/std/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,31 @@ mod tests {
{
}

trait SignedImpl<'a>: IntImpl<'a> + Neg<Output = Self> {}

impl AllImpl<'_> for Uint64 {}
impl AllImpl<'_> for Uint128 {}
impl AllImpl<'_> for Uint256 {}
impl AllImpl<'_> for Uint512 {}
impl AllImpl<'_> for Int64 {}
impl AllImpl<'_> for Int128 {}
impl AllImpl<'_> for Int256 {}
impl AllImpl<'_> for Int512 {}

impl IntImpl<'_> for Int64 {}
impl IntImpl<'_> for Int128 {}
impl IntImpl<'_> for Int256 {}
impl IntImpl<'_> for Int512 {}
impl IntImpl<'_> for Uint64 {}
impl IntImpl<'_> for Uint128 {}
impl IntImpl<'_> for Uint256 {}
impl IntImpl<'_> for Uint512 {}

impl AllImpl<'_> for Decimal {}
impl AllImpl<'_> for Decimal256 {}

impl SignedImpl<'_> for Int64 {}
impl SignedImpl<'_> for Int128 {}
impl SignedImpl<'_> for Int256 {}
impl SignedImpl<'_> for Int512 {}
}

0 comments on commit 8d89684

Please sign in to comment.