diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-15 18:51:23 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-15 18:51:23 +0000 |
commit | 382361c252f6d9e1c9e3fad3bdc4ebe32c5d4b7b (patch) | |
tree | 60e0e6ccfab323471d18e4d5568e8da735af56c6 /crates/syntax/src/ast/node_ext.rs | |
parent | e8c803937ce23a6cf74583ad03f9868869c7eea1 (diff) | |
parent | f3e297331c5c4b8c03810acc745ae5b4a9c4f71f (diff) |
Merge #6552
6552: Properly handle shorthands in destructure patterns when renaming r=SomeoneToIgnore a=Veykril
Fixes #6548 and #6551.
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
-rw-r--r-- | crates/syntax/src/ast/node_ext.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index ce35ac01a..b70b840b8 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs | |||
@@ -203,15 +203,7 @@ impl ast::RecordExprField { | |||
203 | if let Some(name_ref) = self.name_ref() { | 203 | if let Some(name_ref) = self.name_ref() { |
204 | return Some(name_ref); | 204 | return Some(name_ref); |
205 | } | 205 | } |
206 | if let Some(ast::Expr::PathExpr(expr)) = self.expr() { | 206 | self.expr()?.name_ref() |
207 | let path = expr.path()?; | ||
208 | let segment = path.segment()?; | ||
209 | let name_ref = segment.name_ref()?; | ||
210 | if path.qualifier().is_none() { | ||
211 | return Some(name_ref); | ||
212 | } | ||
213 | } | ||
214 | None | ||
215 | } | 207 | } |
216 | } | 208 | } |
217 | 209 | ||