aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-04-29 23:06:12 +0100
committerJonas Schievink <[email protected]>2020-04-29 23:10:30 +0100
commitcafa7a780af8dda22fc87bec75961979cd0801b5 (patch)
tree4d36e4d2b994858b1c6a37d1195ca8a8d1e62ad3 /crates/ra_hir
parent3e41483932ac0b569205abd4e3662c377faf60cf (diff)
Use or-patterns more
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/semantics.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 2f42f877c..75ab2373e 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -49,21 +49,20 @@ impl PathResolution {
49 PathResolution::Def(ModuleDef::BuiltinType(builtin)) => { 49 PathResolution::Def(ModuleDef::BuiltinType(builtin)) => {
50 Some(TypeNs::BuiltinType(*builtin)) 50 Some(TypeNs::BuiltinType(*builtin))
51 } 51 }
52 PathResolution::Def(ModuleDef::Const(_)) => None, 52 PathResolution::Def(ModuleDef::Const(_))
53 PathResolution::Def(ModuleDef::EnumVariant(_)) => None, 53 | PathResolution::Def(ModuleDef::EnumVariant(_))
54 PathResolution::Def(ModuleDef::Function(_)) => None, 54 | PathResolution::Def(ModuleDef::Function(_))
55 PathResolution::Def(ModuleDef::Module(_)) => None, 55 | PathResolution::Def(ModuleDef::Module(_))
56 PathResolution::Def(ModuleDef::Static(_)) => None, 56 | PathResolution::Def(ModuleDef::Static(_))
57 PathResolution::Def(ModuleDef::Trait(_)) => None, 57 | PathResolution::Def(ModuleDef::Trait(_)) => None,
58 PathResolution::Def(ModuleDef::TypeAlias(alias)) => { 58 PathResolution::Def(ModuleDef::TypeAlias(alias)) => {
59 Some(TypeNs::TypeAliasId((*alias).into())) 59 Some(TypeNs::TypeAliasId((*alias).into()))
60 } 60 }
61 PathResolution::Local(_) => None, 61 PathResolution::Local(_) | PathResolution::Macro(_) => None,
62 PathResolution::TypeParam(param) => Some(TypeNs::GenericParam((*param).into())), 62 PathResolution::TypeParam(param) => Some(TypeNs::GenericParam((*param).into())),
63 PathResolution::SelfType(impl_def) => Some(TypeNs::SelfType((*impl_def).into())), 63 PathResolution::SelfType(impl_def) => Some(TypeNs::SelfType((*impl_def).into())),
64 PathResolution::Macro(_) => None, 64 PathResolution::AssocItem(AssocItem::Const(_))
65 PathResolution::AssocItem(AssocItem::Const(_)) => None, 65 | PathResolution::AssocItem(AssocItem::Function(_)) => None,
66 PathResolution::AssocItem(AssocItem::Function(_)) => None,
67 PathResolution::AssocItem(AssocItem::TypeAlias(alias)) => { 66 PathResolution::AssocItem(AssocItem::TypeAlias(alias)) => {
68 Some(TypeNs::TypeAliasId((*alias).into())) 67 Some(TypeNs::TypeAliasId((*alias).into()))
69 } 68 }