internal: remove needless distinction between a carte and its root mod

This commit is contained in:
Aleksey Kladov
2021-07-11 14:55:24 +03:00
parent dedf0ff7c5
commit f42648e305
4 changed files with 7 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<(
let name_ref = ast::NameRef::cast(ident.parent()?)?;
let def = match NameRefClass::classify(&ctx.sema, &name_ref)? {
NameRefClass::Definition(def) => def,
NameRefClass::ExternCrate(_) | NameRefClass::FieldShorthand { .. } => return None,
NameRefClass::FieldShorthand { .. } => return None,
};
let fun = match def {
Definition::ModuleDef(hir::ModuleDef::Function(it)) => it,