Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/items/traits.rs')
-rw-r--r--crates/parser/src/grammar/items/traits.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs
index a8a1ccb15e..c215185d63 100644
--- a/crates/parser/src/grammar/items/traits.rs
+++ b/crates/parser/src/grammar/items/traits.rs
@@ -119,11 +119,11 @@ fn not_a_qualified_path(p: &Parser<'_>) -> bool {
// we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`)
// because this is what almost always expected in practice, qualified paths in impls
// (`impl <Type>::AssocTy { ... }`) aren't even allowed by type checker at the moment.
- if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == T![const] {
+ if [T![#], T![>], T![const]].contains(&p.nth(1)) {
return true;
}
- (p.nth(1) == LIFETIME_IDENT || p.nth(1) == IDENT)
- && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=])
+ ([LIFETIME_IDENT, IDENT].contains(&p.nth(1)))
+ && ([T![>], T![,], T![:], T![=]].contains(&p.nth(2)))
}
// test_err impl_type