pub fn clamp<T>(input: T, min: T, max: T) -> Twhere
T: PartialOrd,
Expand description
A value bounded by a minimum and a maximum
If input is less than min then this returns min. If input is greater than max then this returns max. Otherwise this returns input.
Panics in debug mode if !(min <= max)
.