From 7a1ca0083790c7e19c856a0c5aaae46d560e6181 Mon Sep 17 00:00:00 2001 From: daviddoji Date: Sat, 13 Jul 2024 17:39:46 +0200 Subject: [PATCH] solution to exercise 04_05 --- exercises/04_traits/05_trait_bounds/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exercises/04_traits/05_trait_bounds/src/lib.rs b/exercises/04_traits/05_trait_bounds/src/lib.rs index 10f0eb4..9327d86 100644 --- a/exercises/04_traits/05_trait_bounds/src/lib.rs +++ b/exercises/04_traits/05_trait_bounds/src/lib.rs @@ -6,7 +6,10 @@ // collections (e.g. BTreeMap). /// Return the minimum of two values. -pub fn min(left: T, right: T) -> T { +pub fn min(left: T, right: T) -> T +where + T: Ord, +{ if left <= right { left } else {