Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustdefault and blanket implsSingle-choice MCQ

Given a blanket impl `impl<T: Display> ToString for T`, you also want to write `impl ToString for MyType` to customize it. What happens when you compile both, and why?

impl<T: Display> ToString for T { fn to_string(&self) -> String { /* ... */ } } struct MyType; impl ToString for MyType { fn to_string(&self) -> String { String::from("custom") } }