We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae62b1b commit 8e49a4cCopy full SHA for 8e49a4c
1 file changed
library/core/src/cmp.rs
@@ -1109,6 +1109,8 @@ pub const trait Ord: [const] Eq + [const] PartialOrd<Self> + PointeeSized {
1109
/// #![feature(clamp_min_max)]
1110
/// assert_eq!(12.clamp_max(10), 10);
1111
/// assert_eq!(4.clamp_max(7), 4);
1112
+ /// let s = "hello";
1113
+ /// assert_eq!(&s[..32.clamp_max(s.len())], s);
1114
/// ```
1115
#[must_use]
1116
#[inline]
0 commit comments