Skip to content

Commit bc42b83

Browse files
tarciericuviper
authored andcommitted
Rename to ConstZero/ConstOne and re-export from toplevel
1 parent 536dcf2 commit bc42b83

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/identities.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub trait Zero: Sized + Add<Self, Output = Self> {
3333
///
3434
/// Types which impl both this trait and [`PartialEq`] will receive a blanket
3535
/// impl of the [`Zero`] trait.
36-
pub trait ZeroConstant: Zero {
36+
pub trait ConstZero: Zero {
3737
/// The additive identity element of `Self`, `0`.
3838
const ZERO: Self;
3939
}
@@ -51,7 +51,7 @@ macro_rules! zero_impl {
5151
}
5252
}
5353

54-
impl ZeroConstant for $t {
54+
impl ConstZero for $t {
5555
const ZERO: Self = $v;
5656
}
5757
};
@@ -91,7 +91,7 @@ where
9191
}
9292
}
9393

94-
impl<T: ZeroConstant> ZeroConstant for Wrapping<T>
94+
impl<T: ConstZero> ConstZero for Wrapping<T>
9595
where
9696
Wrapping<T>: Add<Output = Wrapping<T>>,
9797
{
@@ -141,7 +141,7 @@ pub trait One: Sized + Mul<Self, Output = Self> {
141141
///
142142
/// Types which impl both this trait and [`PartialEq`] will receive a blanket
143143
/// impl of the [`One`] trait.
144-
pub trait OneConstant: One {
144+
pub trait ConstOne: One {
145145
/// The multiplicative identity element of `Self`, `1`.
146146
const ONE: Self;
147147
}
@@ -159,7 +159,7 @@ macro_rules! one_impl {
159159
}
160160
}
161161

162-
impl OneConstant for $t {
162+
impl ConstOne for $t {
163163
const ONE: Self = $v;
164164
}
165165
};
@@ -195,7 +195,7 @@ where
195195
}
196196
}
197197

198-
impl<T: OneConstant> OneConstant for Wrapping<T>
198+
impl<T: ConstOne> ConstOne for Wrapping<T>
199199
where
200200
Wrapping<T>: Mul<Output = Wrapping<T>>,
201201
{

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use crate::float::Float;
3333
pub use crate::float::FloatConst;
3434
// pub use real::{FloatCore, Real}; // NOTE: Don't do this, it breaks `use num_traits::*;`.
3535
pub use crate::cast::{cast, AsPrimitive, FromPrimitive, NumCast, ToPrimitive};
36-
pub use crate::identities::{one, zero, One, Zero};
36+
pub use crate::identities::{one, zero, ConstOne, ConstZero, One, Zero};
3737
pub use crate::int::PrimInt;
3838
pub use crate::ops::bytes::{FromBytes, ToBytes};
3939
pub use crate::ops::checked::{

0 commit comments

Comments
 (0)