diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-31 19:12:38 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-31 19:12:38 +0100 |
commit | 38ab326aac70484cb951fe9389d788d525d41550 (patch) | |
tree | 0032223efeefca76340fb0a97f6f12d0e432a2a9 /crates/ra_assists/src/handlers/reorder_fields.rs | |
parent | 5cade89d730b025082ff2df70aace259951a9ccf (diff) | |
parent | 98181087984157e27faba0b969e384f3c62c39d5 (diff) |
Merge #5631
5631: Finalize pattern grammar r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/reorder_fields.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/reorder_fields.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/reorder_fields.rs b/crates/ra_assists/src/handlers/reorder_fields.rs index 120250e79..c9b743a06 100644 --- a/crates/ra_assists/src/handlers/reorder_fields.rs +++ b/crates/ra_assists/src/handlers/reorder_fields.rs | |||
@@ -57,7 +57,7 @@ fn reorder<R: AstNode>(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
57 | fn get_fields_kind(node: &SyntaxNode) -> Vec<SyntaxKind> { | 57 | fn get_fields_kind(node: &SyntaxNode) -> Vec<SyntaxKind> { |
58 | match node.kind() { | 58 | match node.kind() { |
59 | RECORD_EXPR => vec![RECORD_EXPR_FIELD], | 59 | RECORD_EXPR => vec![RECORD_EXPR_FIELD], |
60 | RECORD_PAT => vec![RECORD_FIELD_PAT, BIND_PAT], | 60 | RECORD_PAT => vec![RECORD_PAT_FIELD, IDENT_PAT], |
61 | _ => vec![], | 61 | _ => vec![], |
62 | } | 62 | } |
63 | } | 63 | } |
@@ -66,7 +66,7 @@ fn get_field_name(node: &SyntaxNode) -> String { | |||
66 | let res = match_ast! { | 66 | let res = match_ast! { |
67 | match node { | 67 | match node { |
68 | ast::RecordExprField(field) => field.field_name().map(|it| it.to_string()), | 68 | ast::RecordExprField(field) => field.field_name().map(|it| it.to_string()), |
69 | ast::RecordFieldPat(field) => field.field_name().map(|it| it.to_string()), | 69 | ast::RecordPatField(field) => field.field_name().map(|it| it.to_string()), |
70 | _ => None, | 70 | _ => None, |
71 | } | 71 | } |
72 | }; | 72 | }; |