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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 39 deletions

View file

@ -223,7 +223,7 @@ impl FormatRule<Suite, PyFormatContext<'_>> for FormatSuite {
// the leading comment. This is why the suite handling counts the lines before the
// start of the next statement or before the first leading comments for compound statements.
let start = if let Some(first_leading) = comments.leading(following).first() {
first_leading.slice().start()
first_leading.start()
} else {
following.start()
};