mirror of https://github.com/astral-sh/ruff
Hint that the unwrap should always succeed.
This commit is contained in:
parent
c9364718b4
commit
1468fe46ab
|
|
@ -1125,7 +1125,11 @@ where
|
||||||
|
|
||||||
fn eat_single_char(&mut self, ty: Tok) {
|
fn eat_single_char(&mut self, ty: Tok) {
|
||||||
let tok_start = self.get_pos();
|
let tok_start = self.get_pos();
|
||||||
self.next_char();
|
self.next_char().unwrap_or_else(|| unsafe {
|
||||||
|
// SAFETY: eat_single_char has been called only after a character has been read
|
||||||
|
// from the window, so the window is guaranteed to be non-empty.
|
||||||
|
std::hint::unreachable_unchecked()
|
||||||
|
});
|
||||||
let tok_end = self.get_pos();
|
let tok_end = self.get_pos();
|
||||||
self.emit((tok_start, ty, tok_end));
|
self.emit((tok_start, ty, tok_end));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue