Quiz · Generics and traits · lesson 2 of 8
Quiz — > on T
What happens when this program is built and run?
fn largest<T>(a: T, b: T) -> T {
if a > b { a } else { b }
}
fn main() {
println!("{}", largest(7, 3));
}What happens when this program is built and run?
fn largest<T>(a: T, b: T) -> T {
if a > b { a } else { b }
}
fn main() {
println!("{}", largest(7, 3));
}