Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustFrom and Into conversionsSingle-choice MCQ

Why is the bound `where T: Into<String>` often preferred over `where T: From<&str>` for a function that accepts "string-like" arguments?

fn greet<T: Into<String>>(name: T) -> String { format!("Hi, {}", name.into()) }