From e68934277fad7d34f3cc65b8862c9e50bdc3737d Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Sat, 4 Jul 2015 22:54:59 +0200 Subject: [PATCH] Add missing #[inline] to min_value/max_value on integers Spotted a compiled function call to num::usize::min_value, I'd prefer the 0 to be inlined. --- src/libcore/num/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 97b4f77675533..fd5ef4b1cccca 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -668,10 +668,12 @@ macro_rules! uint_impl { $mul_with_overflow:path) => { /// Returns the smallest value that can be represented by this integer type. #[stable(feature = "rust1", since = "1.0.0")] + #[inline] pub fn min_value() -> Self { 0 } /// Returns the largest value that can be represented by this integer type. #[stable(feature = "rust1", since = "1.0.0")] + #[inline] pub fn max_value() -> Self { !0 } /// Converts a string slice in a given base to an integer.