mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
Hint that the unwrap should always succeed.
This commit is contained in:
@@ -1125,7 +1125,11 @@ where
|
||||
|
||||
fn eat_single_char(&mut self, ty: Tok) {
|
||||
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();
|
||||
self.emit((tok_start, ty, tok_end));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user