solution to exercise 04_05
This commit is contained in:
1 parent
1789d43730
commit
7a1ca00837
1 file changed
+4
-1
@@ -6,7 +6,10 @@
|
|||||||
// collections (e.g. BTreeMap).
|
// collections (e.g. BTreeMap).
|
||||||
|
|
||||||
/// Return the minimum of two values.
|
/// Return the minimum of two values.
|
||||||
pub fn min<T>(left: T, right: T) -> T {
|
pub fn min<T>(left: T, right: T) -> T
|
||||||
|
where
|
||||||
|
T: Ord,
|
||||||
|
{
|
||||||
if left <= right {
|
if left <= right {
|
||||||
left
|
left
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user