/// // Good
/// let a = 42
/// ```
+ #[clippy::version = "pre 1.29.0"]
pub REDUNDANT_CLOSURE_CALL,
complexity,
"throwaway closures called in the expression they are defined"
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;
}