traits: inline Saturating methods
This commit is contained in:
parent
eefa2a85d0
commit
fa451ac00c
|
@ -12,10 +12,12 @@ pub trait Saturating {
|
||||||
macro_rules! saturating_impl {
|
macro_rules! saturating_impl {
|
||||||
($trait_name:ident for $($t:ty)*) => {$(
|
($trait_name:ident for $($t:ty)*) => {$(
|
||||||
impl $trait_name for $t {
|
impl $trait_name for $t {
|
||||||
|
#[inline]
|
||||||
fn saturating_add(self, v: Self) -> Self {
|
fn saturating_add(self, v: Self) -> Self {
|
||||||
Self::saturating_add(self, v)
|
Self::saturating_add(self, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn saturating_sub(self, v: Self) -> Self {
|
fn saturating_sub(self, v: Self) -> Self {
|
||||||
Self::saturating_sub(self, v)
|
Self::saturating_sub(self, v)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue