Add inline attribute

This commit is contained in:
Jacob Kiesel 2017-02-07 10:49:28 -07:00
parent b346f9c2df
commit 182e08a091
1 changed files with 1 additions and 0 deletions

View File

@ -114,6 +114,7 @@ pub mod rational {
///
/// If input is less than min then min is returned, if input is greater than max then max is
/// returned. Otherwise input is returned.
#[inline]
pub fn clamp<T: PartialOrd + Copy>(input: T, min: T, max: T) -> T {
debug_assert!(min < max, "min must be less than max");
if input <= min {min}