diff --git a/src/helpers.rs b/src/helpers.rs index 0549a1b..20a0906 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -7,15 +7,6 @@ pub const fn min(a: usize, b: usize) -> usize { } } -#[cfg(feature = "nightly_features")] -pub const fn sub_or_zero(a: usize, b: usize) -> usize { - if a > b { - a - b - } else { - 0 - } -} - #[cfg(feature = "nightly_features")] pub const fn ceiling_div(x: usize, d: usize) -> usize { x / d + (x % d != 0) as usize diff --git a/src/lib.rs b/src/lib.rs index db3dfbc..2f0df22 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,7 +58,7 @@ mod helpers; mod into; #[cfg(feature = "nightly_features")] -use helpers::{ceiling_div, min, sub_or_zero}; +use helpers::{ceiling_div, min}; pub use from::FromIteratorFixed; pub use into::IntoIteratorFixed; @@ -164,7 +164,7 @@ where #[inline] pub fn skip( self, - ) -> IteratorFixed, { sub_or_zero(N, SKIP) }> { + ) -> IteratorFixed, { N.saturating_sub(SKIP) }> { IteratorFixed { inner: self.inner.skip(SKIP), }