diff options
author | unexge <[email protected]> | 2020-06-08 13:37:12 +0100 |
---|---|---|
committer | unexge <[email protected]> | 2020-06-08 13:37:12 +0100 |
commit | 4edf736eb23c2d94a8c65a83a83201590e847b3f (patch) | |
tree | bdeaebc8fa59a78e00e9abac550a9304cb65bc55 /crates/ra_ide_db/src | |
parent | c5d5d2185816d90ad1420fe544d93150cb9c9a48 (diff) |
Swap `into_definition` and `definition` semantics for `FieldShorthand` variant
Diffstat (limited to 'crates/ra_ide_db/src')
-rw-r--r-- | crates/ra_ide_db/src/defs.rs | 4 |
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 | } |