solution to exercise 04_05

This commit is contained in:
David Doblas Jiménez 2024-07-13 17:39:46 +02:00
parent 1789d43730
commit 7a1ca00837

View File

@ -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 {