Fix the Generic
This generic function tries to compare two values, but it's missing a trait bound! Add the right bound so the code compiles.
Fix the code so it prints:
text
Larger: 20
Hint: To use >=, the type needs the PartialOrd trait bound.
rust
fn largest<T>(a: T, b: T) -> T {
if a >= b {
a
} else {
b
}
}
fn main() {
println!("Larger: {}", largest(10, 20));
}