mirror of https://github.com/astral-sh/ruff
Rename variable
This commit is contained in:
parent
7d47f711c1
commit
5ecf3c3374
|
|
@ -67,7 +67,7 @@ impl<'src> TokenSource<'src> {
|
||||||
///
|
///
|
||||||
/// [`re_lex_logical_token`]: Lexer::re_lex_logical_token
|
/// [`re_lex_logical_token`]: Lexer::re_lex_logical_token
|
||||||
pub(crate) fn re_lex_logical_token(&mut self) {
|
pub(crate) fn re_lex_logical_token(&mut self) {
|
||||||
let mut non_logical_line = None;
|
let mut non_logical_newline = None;
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
let last_non_trivia_end_before = {
|
let last_non_trivia_end_before = {
|
||||||
|
|
@ -81,7 +81,7 @@ impl<'src> TokenSource<'src> {
|
||||||
for (index, token) in self.tokens.iter().enumerate().rev() {
|
for (index, token) in self.tokens.iter().enumerate().rev() {
|
||||||
match token.kind() {
|
match token.kind() {
|
||||||
TokenKind::NonLogicalNewline => {
|
TokenKind::NonLogicalNewline => {
|
||||||
non_logical_line = Some((index, token.start()));
|
non_logical_newline = Some((index, token.start()));
|
||||||
}
|
}
|
||||||
TokenKind::Comment => continue,
|
TokenKind::Comment => continue,
|
||||||
_ => break,
|
_ => break,
|
||||||
|
|
@ -90,12 +90,12 @@ impl<'src> TokenSource<'src> {
|
||||||
|
|
||||||
if !self
|
if !self
|
||||||
.lexer
|
.lexer
|
||||||
.re_lex_logical_token(non_logical_line.map(|(_, start)| start))
|
.re_lex_logical_token(non_logical_newline.map(|(_, start)| start))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let non_logical_line_index = non_logical_line
|
let non_logical_line_index = non_logical_newline
|
||||||
.expect(
|
.expect(
|
||||||
"`re_lex_logical_token` should only return `true` if `non_logical_line` is `Some`",
|
"`re_lex_logical_token` should only return `true` if `non_logical_line` is `Some`",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue