Skip to content

Commit ae1ebed

Browse files
authored
Unrolled build for rust-lang#125455
Rollup merge of rust-lang#125455 - blyxyas:opt-clamp, r=joboet Make `clamp` inline Context: rust-lang/rust-clippy#12826 This results in slightly more optimized assembly. (And most important, it's now less than lines than just manually clamping a value)
2 parents 9e297bf + d6e6918 commit ae1ebed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/cmp.rs

+1
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
898898
/// assert_eq!(2.clamp(-2, 1), 1);
899899
/// ```
900900
#[must_use]
901+
#[inline]
901902
#[stable(feature = "clamp", since = "1.50.0")]
902903
fn clamp(self, min: Self, max: Self) -> Self
903904
where

0 commit comments

Comments
 (0)