From 95c8c65139c10e4de44367fead8dff88511e6d46 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 17 Jun 2021 17:37:14 +0200 Subject: Nest all the or-patterns! --- crates/hir/src/semantics.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 613266e07..43162797e 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs @@ -51,12 +51,14 @@ impl PathResolution { PathResolution::Def(ModuleDef::BuiltinType(builtin)) => { Some(TypeNs::BuiltinType((*builtin).into())) } - PathResolution::Def(ModuleDef::Const(_)) - | PathResolution::Def(ModuleDef::Variant(_)) - | PathResolution::Def(ModuleDef::Function(_)) - | PathResolution::Def(ModuleDef::Module(_)) - | PathResolution::Def(ModuleDef::Static(_)) - | PathResolution::Def(ModuleDef::Trait(_)) => None, + PathResolution::Def( + ModuleDef::Const(_) + | ModuleDef::Variant(_) + | ModuleDef::Function(_) + | ModuleDef::Module(_) + | ModuleDef::Static(_) + | ModuleDef::Trait(_), + ) => None, PathResolution::Def(ModuleDef::TypeAlias(alias)) => { Some(TypeNs::TypeAliasId((*alias).into())) } @@ -65,8 +67,7 @@ impl PathResolution { } PathResolution::TypeParam(param) => Some(TypeNs::GenericParam((*param).into())), PathResolution::SelfType(impl_def) => Some(TypeNs::SelfType((*impl_def).into())), - PathResolution::AssocItem(AssocItem::Const(_)) - | PathResolution::AssocItem(AssocItem::Function(_)) => None, + PathResolution::AssocItem(AssocItem::Const(_) | AssocItem::Function(_)) => None, PathResolution::AssocItem(AssocItem::TypeAlias(alias)) => { Some(TypeNs::TypeAliasId((*alias).into())) } -- cgit v1.2.3