]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/redundant_closure_call.rs
Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup
[rust.git] / clippy_lints / src / redundant_closure_call.rs
index 7314bce83e03867d83c8e6f7e2300d9485360f60..0de282542fc3c73fc0e15446364b1505e1b3c3b8 100644 (file)
@@ -30,6 +30,7 @@
     /// // Good
     /// let a = 42
     /// ```
+    #[clippy::version = "pre 1.29.0"]
     pub REDUNDANT_CLOSURE_CALL,
     complexity,
     "throwaway closures called in the expression they are defined"
@@ -51,9 +52,7 @@ fn new() -> Self {
 
 impl<'ast> ast_visit::Visitor<'ast> for ReturnVisitor {
     fn visit_expr(&mut self, ex: &'ast ast::Expr) {
-        if let ast::ExprKind::Ret(_) = ex.kind {
-            self.found_return = true;
-        } else if let ast::ExprKind::Try(_) = ex.kind {
+        if let ast::ExprKind::Ret(_) | ast::ExprKind::Try(_) = ex.kind {
             self.found_return = true;
         }