diff --git a/crates/ide-assists/src/handlers/into_to_qualified_from.rs b/crates/ide-assists/src/handlers/into_to_qualified_from.rs index 0589cbaf8a7..965e4aa786e 100644 --- a/crates/ide-assists/src/handlers/into_to_qualified_from.rs +++ b/crates/ide-assists/src/handlers/into_to_qualified_from.rs @@ -66,10 +66,10 @@ pub(crate) fn into_to_qualified_from(acc: &mut Assists, ctx: &AssistContext<'_>) |edit| { edit.replace( method_call.syntax().text_range(), - if sc.chars().find(|c| !c.is_alphanumeric() && c != &':').is_some() { - format!("<{}>::from({})", sc, receiver) - } else { + if sc.chars().all(|c| c.is_alphanumeric() || c == ':') { format!("{}::from({})", sc, receiver) + } else { + format!("<{}>::from({})", sc, receiver) }, ); },