diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs index 0e7e4277dd6c..8e48fcf58721 100644 --- a/src/libstd/num/int_macros.rs +++ b/src/libstd/num/int_macros.rs @@ -308,7 +308,7 @@ impl Integer for $T { /// Returns `true` if the number is divisible by `2` #[inline] - fn is_even(&self) -> bool { self.is_multiple_of(&2) } + fn is_even(&self) -> bool { self & 1 == 0 } /// Returns `true` if the number is not divisible by `2` #[inline] diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs index 1a256981d74e..852fc5016b01 100644 --- a/src/libstd/num/uint_macros.rs +++ b/src/libstd/num/uint_macros.rs @@ -169,7 +169,7 @@ impl Integer for $T { /// Returns `true` if the number is divisible by `2` #[inline] - fn is_even(&self) -> bool { self.is_multiple_of(&2) } + fn is_even(&self) -> bool { self & 1 == 0 } /// Returns `true` if the number is not divisible by `2` #[inline]