From a5445b7619155ca795d29b0786c9723d5f424b64 Mon Sep 17 00:00:00 2001 From: Jacob Kiesel Date: Tue, 7 Feb 2017 10:18:23 -0700 Subject: [PATCH] Adding documentation comments --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5b98681..bfef442 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,7 +109,10 @@ pub mod traits { pub mod rational { pub use num_rational::*; } - +/// A value bounded by a minimum and a maximum +/// +/// If input is less than min then min is returned, if input is greater than max then max is +/// returned. Otherwise input is returned. pub fn clamp(input: T, min: T, max: T) -> T { debug_assert!(min < max, "min must be less than max"); if input <= min {min}