return value directly from if/else block

This commit is contained in:
Daniel Eades 2022-12-30 09:59:22 +00:00
parent 4f8ffd0ba4
commit 0a0817905e
2 changed files with 9 additions and 8 deletions

View file

@ -83,11 +83,12 @@ fn path_segment(p: &mut Parser<'_>, mode: Mode, first: bool) {
}
p.expect(T![>]);
} else {
let mut empty = true;
if first {
let empty = if first {
p.eat(T![::]);
empty = false;
}
false
} else {
true
};
match p.current() {
IDENT => {
name_ref(p);