Exercise 7 · Chapter: GenericsRequired+50 XP
Where Clause
Rewrite this function using a where clause instead of inline trait bounds. The function should compare two values and print which is smaller.
Expected output:
Smaller: 3
Hints:
- Move the bounds from
<T: ...>towhere T: PartialOrd + std::fmt::Display - The
whereclause goes after the parameter list, before the{
rust
fn main() {
}
Output
Run your code to see the output here.