traits: inline Saturating methods

This commit is contained in:
Josh Stone 2016-08-10 22:21:53 -07:00
parent eefa2a85d0
commit fa451ac00c
1 changed files with 2 additions and 0 deletions

View File

@ -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)
} }