diff options
| author | Catherine <114838443+Centri3@users.noreply.github.com> | 2023-04-21 10:59:36 -0500 |
|---|---|---|
| committer | Centri3 <114838443+Centri3@users.noreply.github.com> | 2023-06-07 18:34:34 -0500 |
| commit | a9da61b1153edd8a8b49226ffd433e0c6a402e38 (patch) | |
| tree | 85b28fd5225a9f7282dc6d94ce0b9b84b54db098 | |
| parent | e68dbc3308397e68d672f9f70742af41897b06be (diff) | |
| download | rust-a9da61b1153edd8a8b49226ffd433e0c6a402e38.tar.gz rust-a9da61b1153edd8a8b49226ffd433e0c6a402e38.zip | |
couple more notes
| -rw-r--r-- | clippy_lints/src/excessive_nesting.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clippy_lints/src/excessive_nesting.rs b/clippy_lints/src/excessive_nesting.rs index a60e2442fa2..604448d2e9c 100644 --- a/clippy_lints/src/excessive_nesting.rs +++ b/clippy_lints/src/excessive_nesting.rs @@ -106,6 +106,8 @@ impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> { } fn visit_block(&mut self, block: &Block) { + // TODO: Can we use some RAII guard instead? Borrow checker seems to hate that + // idea but it would be a lot cleaner. self.nest_level += 1; if !check_indent(self, block.span) { @@ -167,6 +169,8 @@ impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> { fn visit_expr(&mut self, expr: &Expr) { // This is a mess, but really all it does is extract every expression from every applicable variant // of ExprKind until it finds a Block. + // TODO: clippy_utils has the two functions for_each_expr and for_each_expr_with_closures, can those + // be used here or are they not applicable for this case? match &expr.kind { ExprKind::ConstBlock(anon_const) => self.visit_expr(&anon_const.value), ExprKind::Call(.., args) => { |
