Accept any Into<AnyNodeRef> as Comments arguments (#5205)
This commit is contained in:
@@ -23,7 +23,7 @@ impl FormatNodeRule<StmtIf> for FormatStmtIf {
|
||||
} = current_statement;
|
||||
|
||||
let first_statement = body.first().ok_or(FormatError::SyntaxError)?;
|
||||
let trailing = comments.dangling_comments(current_statement.into());
|
||||
let trailing = comments.dangling_comments(current_statement);
|
||||
|
||||
let trailing_if_comments_end = trailing
|
||||
.partition_point(|comment| comment.slice().start() < first_statement.start());
|
||||
@@ -32,7 +32,7 @@ impl FormatNodeRule<StmtIf> for FormatStmtIf {
|
||||
trailing.split_at(trailing_if_comments_end);
|
||||
|
||||
if current.is_elif() {
|
||||
let elif_leading = comments.leading_comments(current_statement.into());
|
||||
let elif_leading = comments.leading_comments(current_statement);
|
||||
// Manually format the leading comments because the formatting bypasses `NodeRule::fmt`
|
||||
write!(
|
||||
f,
|
||||
|
||||
Reference in New Issue
Block a user