Calculates the minimum of two values.
fn min<T>(one: T, two: T) -> T
where T: Ord<T>,| Name | Description |
|---|---|
| one | The first value. |
| two | The second value. |
Returns the smaller one of the two values.
If the comparison of both objects returns that they are equal, the first one is returned.
Since this function takes ownership of the objects and drops one of them, it is mostly useful for type that implement Copy.
assert!(min(1, 2) == 1);