aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/grammar/items
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/grammar/items')
-rw-r--r--crates/ra_syntax/src/grammar/items/nominal.rs4
-rw-r--r--crates/ra_syntax/src/grammar/items/traits.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/grammar/items/nominal.rs b/crates/ra_syntax/src/grammar/items/nominal.rs
index 0784fb7b1..897306883 100644
--- a/crates/ra_syntax/src/grammar/items/nominal.rs
+++ b/crates/ra_syntax/src/grammar/items/nominal.rs
@@ -70,7 +70,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) {
70 } 70 }
71 let var = p.start(); 71 let var = p.start();
72 attributes::outer_attributes(p); 72 attributes::outer_attributes(p);
73 if p.at(IDENT) { 73 if p.current().is_ident() {
74 name(p); 74 name(p);
75 match p.current() { 75 match p.current() {
76 L_CURLY => named_field_def_list(p), 76 L_CURLY => named_field_def_list(p),
@@ -120,7 +120,7 @@ pub(crate) fn named_field_def_list(p: &mut Parser) {
120 // } 120 // }
121 attributes::outer_attributes(p); 121 attributes::outer_attributes(p);
122 opt_visibility(p); 122 opt_visibility(p);
123 if p.at(IDENT) { 123 if p.current().is_ident() {
124 name(p); 124 name(p);
125 p.expect(COLON); 125 p.expect(COLON);
126 types::type_(p); 126 types::type_(p);
diff --git a/crates/ra_syntax/src/grammar/items/traits.rs b/crates/ra_syntax/src/grammar/items/traits.rs
index 0a0621753..a78bbba2b 100644
--- a/crates/ra_syntax/src/grammar/items/traits.rs
+++ b/crates/ra_syntax/src/grammar/items/traits.rs
@@ -112,7 +112,7 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool {
112 if p.nth(1) == POUND || p.nth(1) == R_ANGLE { 112 if p.nth(1) == POUND || p.nth(1) == R_ANGLE {
113 return true; 113 return true;
114 } 114 }
115 (p.nth(1) == LIFETIME || p.nth(1) == IDENT) 115 (p.nth(1) == LIFETIME || p.nth(1).is_ident())
116 && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ) 116 && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ)
117} 117}
118 118