]> git.lizzy.rs Git - rust.git/commitdiff
Prefer TYPE_FIRST
authorErlend Tobiassen <erlend.tobiassen@gmail.com>
Tue, 22 Jan 2019 13:36:57 +0000 (14:36 +0100)
committerErlend Tobiassen <erlend.tobiassen@gmail.com>
Tue, 22 Jan 2019 13:36:57 +0000 (14:36 +0100)
crates/ra_syntax/src/grammar/types.rs

index 83a54c190f6f0d23f40325a61dcc11fbac0003f8..c626abcfda2566b15f708b7c42c0bef5fdddc1b1 100644 (file)
@@ -37,10 +37,10 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) {
 }
 
 pub(super) fn is_type_start(p: &mut Parser) -> bool {
-    match p.current() {
-        L_PAREN | EXCL | STAR | L_BRACK | AMP | UNDERSCORE | FN_KW | FOR_KW | IMPL_KW | DYN_KW
-        | L_ANGLE => true,
-        _ => paths::is_path_start(p),
+    if TYPE_FIRST.contains(p.current()) {
+        true
+    } else {
+        paths::is_path_start(p)
     }
 }