Unnamed repository; edit this file 'description' to name the repository.
minor: simplify
| -rw-r--r-- | crates/parser/src/grammar/generic_args.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/crates/parser/src/grammar/generic_args.rs b/crates/parser/src/grammar/generic_args.rs index b409baed4d..f8b2f74a3a 100644 --- a/crates/parser/src/grammar/generic_args.rs +++ b/crates/parser/src/grammar/generic_args.rs @@ -48,16 +48,8 @@ fn generic_arg(p: &mut Parser) { path_ty.abandon(p); m.complete(p, ASSOC_TYPE_ARG); } - T![:] if p.at(T![::]) => { - // NameRef::, this is a path type - path_seg.complete(p, PATH_SEGMENT); - let qual = path.complete(p, PATH); - paths::type_path_for_qualifier(p, qual); - path_ty.complete(p, PATH_TYPE); - m.complete(p, TYPE_ARG); - } // NameRef<...>: - T![:] => { + T![:] if !p.at(T![::]) => { generic_params::bounds(p); path_seg.abandon(p); @@ -65,10 +57,10 @@ fn generic_arg(p: &mut Parser) { path_ty.abandon(p); m.complete(p, ASSOC_TYPE_ARG); } - // NameRef, this is a single segment path type _ => { path_seg.complete(p, PATH_SEGMENT); - path.complete(p, PATH); + let qual = path.complete(p, PATH); + paths::type_path_for_qualifier(p, qual); path_ty.complete(p, PATH_TYPE); m.complete(p, TYPE_ARG); } |