Skip to content

Commit 48ece04

Browse files
committed
Add min_value and max_value
1 parent ee4bdb9 commit 48ece04

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/internal_type_traits.rs

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ pub(crate) trait Integral:
5555
{
5656
fn zero() -> Self;
5757
fn one() -> Self;
58+
fn min_value() -> Self;
59+
fn max_value() -> Self;
5860
}
5961

6062
macro_rules! impl_integral {
@@ -70,6 +72,16 @@ macro_rules! impl_integral {
7072
fn one() -> Self {
7173
1
7274
}
75+
76+
#[inline]
77+
fn min_value() -> Self {
78+
Self::min_value()
79+
}
80+
81+
#[inline]
82+
fn max_value() -> Self {
83+
Self::max_value()
84+
}
7385
}
7486
)*
7587
};

0 commit comments

Comments
 (0)