]> git.lizzy.rs Git - rust.git/commitdiff
minor: simplify
authorAleksey Kladov <aleksey.kladov@gmail.com>
Fri, 17 Sep 2021 20:31:37 +0000 (23:31 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Fri, 17 Sep 2021 20:31:37 +0000 (23:31 +0300)
crates/parser/src/grammar.rs

index bca1b7b2aa40397f0836c33876139f530604ac5a..23f0cc0153a9a37e200979b756bafb13790f7892 100644 (file)
@@ -167,13 +167,7 @@ fn opt_visibility(p: &mut Parser) -> bool {
                     // struct B(pub (crate::A,));
                     T![crate] | T![self] | T![super] | T![ident] if p.nth(2) != T![:] => {
                         p.bump(T!['(']);
-                        let path_m = p.start();
-                        let path_segment_m = p.start();
-                        let name_ref_m = p.start();
-                        p.bump_any();
-                        name_ref_m.complete(p, NAME_REF);
-                        path_segment_m.complete(p, PATH_SEGMENT);
-                        path_m.complete(p, PATH);
+                        paths::use_path(p);
                         p.expect(T![')']);
                     }
                     // test crate_visibility_in