]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/unnecessary_wrap.rs
Make lint skip closures
[rust.git] / clippy_lints / src / unnecessary_wrap.rs
index fc1a33fc6cd7f5887f355e36bda7433fafe019e1..a20d1f82e9efd1fda9355204251e334b4775954d 100644 (file)
@@ -63,12 +63,10 @@ fn check_fn(
         span: Span,
         hir_id: HirId,
     ) {
-        if_chain! {
-            if let FnKind::ItemFn(.., visibility, _) = fn_kind;
-            if visibility.node.is_pub();
-            then {
-                return;
-            }
+        match fn_kind {
+            FnKind::ItemFn(.., visibility, _) if visibility.node.is_pub() => return,
+            FnKind::Closure(..) => return,
+            _ => (),
         }
 
         let (return_type, path) = if is_type_diagnostic_item(cx, return_ty(cx, hir_id), sym!(option_type)) {