aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db
diff options
context:
space:
mode:
authorunexge <[email protected]>2020-06-08 13:37:12 +0100
committerunexge <[email protected]>2020-06-08 13:37:12 +0100
commit4edf736eb23c2d94a8c65a83a83201590e847b3f (patch)
treebdeaebc8fa59a78e00e9abac550a9304cb65bc55 /crates/ra_ide_db
parentc5d5d2185816d90ad1420fe544d93150cb9c9a48 (diff)
Swap `into_definition` and `definition` semantics for `FieldShorthand` variant
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r--crates/ra_ide_db/src/defs.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 853d856e7..1826f3ac6 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -93,14 +93,14 @@ impl NameClass {
93 match self { 93 match self {
94 NameClass::Definition(it) => Some(it), 94 NameClass::Definition(it) => Some(it),
95 NameClass::ConstReference(_) => None, 95 NameClass::ConstReference(_) => None,
96 NameClass::FieldShorthand { local: _, field } => Some(field), 96 NameClass::FieldShorthand { local, field: _ } => Some(Definition::Local(local)),
97 } 97 }
98 } 98 }
99 99
100 pub fn definition(self) -> Definition { 100 pub fn definition(self) -> Definition {
101 match self { 101 match self {
102 NameClass::Definition(it) | NameClass::ConstReference(it) => it, 102 NameClass::Definition(it) | NameClass::ConstReference(it) => it,
103 NameClass::FieldShorthand { local, field: _ } => Definition::Local(local), 103 NameClass::FieldShorthand { local: _, field } => field,
104 } 104 }
105 } 105 }
106} 106}