Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyRustgenerics basicsSingle-choice MCQ

What does this generic function require of type T to compile?

fn largest<T>(list: &[T]) -> &T { let mut largest = &list[0]; for item in list { if item > largest { largest = item; } } largest }