Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustassociated types vs genericsSingle-choice MCQ

A common rule of thumb: prefer an associated type over a generic type parameter on a trait when which condition holds?

trait Iterator { type Item; fn next(&mut self) -> Option<Self::Item>; }