Skip to content

Commit bb9c2f5

Browse files
committed
Reorder an expression to improve readability.
1 parent 129fe9a commit bb9c2f5

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

compiler/rustc_parse/src/lexer/tokentrees.rs

+7-12
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,14 @@ impl<'a> TokenTreesReader<'a> {
5555
let (this_spacing, next_tok) = loop {
5656
let (next_tok, is_next_tok_preceded_by_whitespace) =
5757
self.string_reader.next_token();
58-
if !is_next_tok_preceded_by_whitespace {
59-
if let Some(glued) = self.token.glue(&next_tok) {
60-
self.token = glued;
61-
} else {
62-
let this_spacing = if next_tok.is_punct() {
63-
Spacing::Joint
64-
} else {
65-
Spacing::Alone
66-
};
67-
break (this_spacing, next_tok);
68-
}
69-
} else {
58+
if is_next_tok_preceded_by_whitespace {
7059
break (Spacing::Alone, next_tok);
60+
} else if let Some(glued) = self.token.glue(&next_tok) {
61+
self.token = glued;
62+
} else {
63+
let this_spacing =
64+
if next_tok.is_punct() { Spacing::Joint } else { Spacing::Alone };
65+
break (this_spacing, next_tok);
7166
}
7267
};
7368
let this_tok = std::mem::replace(&mut self.token, next_tok);

0 commit comments

Comments
 (0)