mirror of https://github.com/astral-sh/ruff
fix when toggling pending escape flag
This commit is contained in:
parent
82ed9ba305
commit
2cb77c674c
|
|
@ -608,10 +608,7 @@ impl FormatString {
|
||||||
Ok((next_char, remaining)) => {
|
Ok((next_char, remaining)) => {
|
||||||
result_string.push(next_char);
|
result_string.push(next_char);
|
||||||
cur_text = remaining;
|
cur_text = remaining;
|
||||||
|
pending_escape = next_char == '\\' && !pending_escape
|
||||||
if next_char == '\\' {
|
|
||||||
pending_escape = !pending_escape
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
return if result_string.is_empty() {
|
return if result_string.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue