mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
Remove unnecessary Comment#slice
calls (#6997)
This commit is contained in:
parent
34e8de738e
commit
b404e54f33
11 changed files with 23 additions and 39 deletions
|
@ -26,7 +26,7 @@ impl FormatNodeRule<StmtWhile> for FormatStmtWhile {
|
|||
|
||||
let body_start = body.first().map_or(test.end(), Stmt::start);
|
||||
let or_else_comments_start =
|
||||
dangling_comments.partition_point(|comment| comment.slice().end() < body_start);
|
||||
dangling_comments.partition_point(|comment| comment.end() < body_start);
|
||||
|
||||
let (trailing_condition_comments, or_else_comments) =
|
||||
dangling_comments.split_at(or_else_comments_start);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue