Skip to content

Commit 67d9e74

Browse files
committed
Avoid Self constructor for Wrapping
1 parent 6ab6de2 commit 67d9e74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/identities.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<T: ConstZero> ConstZero for Wrapping<T>
9292
where
9393
Wrapping<T>: Add<Output = Wrapping<T>>,
9494
{
95-
const ZERO: Self = Self(T::ZERO);
95+
const ZERO: Self = Wrapping(T::ZERO);
9696
}
9797

9898
/// Defines a multiplicative identity element for `Self`.
@@ -193,7 +193,7 @@ impl<T: ConstOne> ConstOne for Wrapping<T>
193193
where
194194
Wrapping<T>: Mul<Output = Wrapping<T>>,
195195
{
196-
const ONE: Self = Self(T::ONE);
196+
const ONE: Self = Wrapping(T::ONE);
197197
}
198198

199199
// Some helper functions provided for backwards compatibility.

0 commit comments

Comments
 (0)