mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +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
|
@ -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()
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue