Skip to content

Commit

Permalink
Avoid Self constructor for Wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Feb 8, 2024
1 parent 6ab6de2 commit 67d9e74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/identities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl<T: ConstZero> ConstZero for Wrapping<T>
where
Wrapping<T>: Add<Output = Wrapping<T>>,
{
const ZERO: Self = Self(T::ZERO);
const ZERO: Self = Wrapping(T::ZERO);
}

/// Defines a multiplicative identity element for `Self`.
Expand Down Expand Up @@ -193,7 +193,7 @@ impl<T: ConstOne> ConstOne for Wrapping<T>
where
Wrapping<T>: Mul<Output = Wrapping<T>>,
{
const ONE: Self = Self(T::ONE);
const ONE: Self = Wrapping(T::ONE);
}

// Some helper functions provided for backwards compatibility.
Expand Down

0 comments on commit 67d9e74

Please sign in to comment.