mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
Use or-patterns more
This commit is contained in:
@@ -49,21 +49,20 @@ fn in_type_ns(&self) -> Option<TypeNs> {
|
||||
PathResolution::Def(ModuleDef::BuiltinType(builtin)) => {
|
||||
Some(TypeNs::BuiltinType(*builtin))
|
||||
}
|
||||
PathResolution::Def(ModuleDef::Const(_)) => None,
|
||||
PathResolution::Def(ModuleDef::EnumVariant(_)) => None,
|
||||
PathResolution::Def(ModuleDef::Function(_)) => None,
|
||||
PathResolution::Def(ModuleDef::Module(_)) => None,
|
||||
PathResolution::Def(ModuleDef::Static(_)) => None,
|
||||
PathResolution::Def(ModuleDef::Trait(_)) => None,
|
||||
PathResolution::Def(ModuleDef::Const(_))
|
||||
| PathResolution::Def(ModuleDef::EnumVariant(_))
|
||||
| PathResolution::Def(ModuleDef::Function(_))
|
||||
| PathResolution::Def(ModuleDef::Module(_))
|
||||
| PathResolution::Def(ModuleDef::Static(_))
|
||||
| PathResolution::Def(ModuleDef::Trait(_)) => None,
|
||||
PathResolution::Def(ModuleDef::TypeAlias(alias)) => {
|
||||
Some(TypeNs::TypeAliasId((*alias).into()))
|
||||
}
|
||||
PathResolution::Local(_) => None,
|
||||
PathResolution::Local(_) | PathResolution::Macro(_) => None,
|
||||
PathResolution::TypeParam(param) => Some(TypeNs::GenericParam((*param).into())),
|
||||
PathResolution::SelfType(impl_def) => Some(TypeNs::SelfType((*impl_def).into())),
|
||||
PathResolution::Macro(_) => None,
|
||||
PathResolution::AssocItem(AssocItem::Const(_)) => None,
|
||||
PathResolution::AssocItem(AssocItem::Function(_)) => None,
|
||||
PathResolution::AssocItem(AssocItem::Const(_))
|
||||
| PathResolution::AssocItem(AssocItem::Function(_)) => None,
|
||||
PathResolution::AssocItem(AssocItem::TypeAlias(alias)) => {
|
||||
Some(TypeNs::TypeAliasId((*alias).into()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user