Skip to content

Commit c584823

Browse files
committed
couple more notes
1 parent dbd8888 commit c584823

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clippy_lints/src/excessive_nesting.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> {
106106
}
107107

108108
fn visit_block(&mut self, block: &Block) {
109+
// TODO: Can we use some RAII guard instead? Borrow checker seems to hate that
110+
// idea but it would be a lot cleaner.
109111
self.nest_level += 1;
110112

111113
if !check_indent(self, block.span) {
@@ -167,6 +169,8 @@ impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> {
167169
fn visit_expr(&mut self, expr: &Expr) {
168170
// This is a mess, but really all it does is extract every expression from every applicable variant
169171
// of ExprKind until it finds a Block.
172+
// TODO: clippy_utils has the two functions for_each_expr and for_each_expr_with_closures, can those
173+
// be used here or are they not applicable for this case?
170174
match &expr.kind {
171175
ExprKind::ConstBlock(anon_const) => self.visit_expr(&anon_const.value),
172176
ExprKind::Call(.., args) => {

0 commit comments

Comments
 (0)