Function clamp

Source
pub fn clamp<T>(val: T, min: T, max: T) -> T
where T: PartialOrd,
Expand description

Restrict value to a certain interval