Fix broken comment in too-many-branches (#11440)

This commit is contained in:
Charlie Marsh
2024-05-15 22:25:20 -04:00
committed by GitHub
parent 27da223e9f
commit 4436dec1d9

View File

@@ -181,8 +181,8 @@ fn num_branches(stmts: &[Stmt]) -> usize {
.map(|case| num_branches(&case.body))
.sum::<usize>()
}
Stmt::With(ast::StmtWith { body, .. }) => num_branches(body), // The `with` statement
// is not considered a branch but the statements inside the `with` should be counted
// The `with` statement is not considered a branch but the statements inside the `with` should be counted.
Stmt::With(ast::StmtWith { body, .. }) => num_branches(body),
Stmt::For(ast::StmtFor { body, orelse, .. })
| Stmt::While(ast::StmtWhile { body, orelse, .. }) => {
1 + num_branches(body)