Remove unnecessary Comment#slice calls (#6997)

This commit is contained in:
Charlie Marsh
2023-08-29 20:44:11 -04:00
committed by GitHub
parent 34e8de738e
commit b404e54f33
11 changed files with 23 additions and 39 deletions

View File

@@ -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);