Skip to content

Commit 0005678

Browse files
committed
minor: simplify
1 parent e458f66 commit 0005678

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

crates/parser/src/grammar/generic_args.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,19 @@ fn generic_arg(p: &mut Parser) {
4848
path_ty.abandon(p);
4949
m.complete(p, ASSOC_TYPE_ARG);
5050
}
51-
T![:] if p.at(T![::]) => {
52-
// NameRef::, this is a path type
53-
path_seg.complete(p, PATH_SEGMENT);
54-
let qual = path.complete(p, PATH);
55-
paths::type_path_for_qualifier(p, qual);
56-
path_ty.complete(p, PATH_TYPE);
57-
m.complete(p, TYPE_ARG);
58-
}
5951
// NameRef<...>:
60-
T![:] => {
52+
T![:] if !p.at(T![::]) => {
6153
generic_params::bounds(p);
6254

6355
path_seg.abandon(p);
6456
path.abandon(p);
6557
path_ty.abandon(p);
6658
m.complete(p, ASSOC_TYPE_ARG);
6759
}
68-
// NameRef, this is a single segment path type
6960
_ => {
7061
path_seg.complete(p, PATH_SEGMENT);
71-
path.complete(p, PATH);
62+
let qual = path.complete(p, PATH);
63+
paths::type_path_for_qualifier(p, qual);
7264
path_ty.complete(p, PATH_TYPE);
7365
m.complete(p, TYPE_ARG);
7466
}

0 commit comments

Comments
 (0)