Skip to content

Commit 74caa63

Browse files
committed
rename bump_if_either to bump_either
1 parent 1587828 commit 74caa63

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_lexer/src/cursor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'a> Cursor<'a> {
117117
}
118118

119119
/// Bumps the cursor if the next character is either of the two expected characters.
120-
pub(crate) fn bump_if_either(&mut self, byte1: char, byte2: char) -> bool {
120+
pub(crate) fn bump_either(&mut self, byte1: char, byte2: char) -> bool {
121121
let mut chars = self.chars.clone();
122122
if let Some(c) = chars.next()
123123
&& (c == byte1 || c == byte2)

compiler/rustc_lexer/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ impl Cursor<'_> {
935935
return true;
936936
}
937937
// Current is '\\', bump again if next is an escaped character.
938-
self.bump_if_either('\\', '"');
938+
self.bump_either('\\', '"');
939939
}
940940
// End of file reached.
941941
false
@@ -1105,7 +1105,7 @@ impl Cursor<'_> {
11051105
/// and returns false otherwise.
11061106
fn eat_float_exponent(&mut self) -> bool {
11071107
debug_assert!(self.prev() == 'e' || self.prev() == 'E');
1108-
self.bump_if_either('-', '+');
1108+
self.bump_either('-', '+');
11091109
self.eat_decimal_digits()
11101110
}
11111111

0 commit comments

Comments
 (0)