Skip to content

Commit ccfd7e2

Browse files
committed
Make lint skip closures
1 parent 96f3973 commit ccfd7e2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

clippy_lints/src/unnecessary_wrap.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
6363
span: Span,
6464
hir_id: HirId,
6565
) {
66-
if_chain! {
67-
if let FnKind::ItemFn(.., visibility, _) = fn_kind;
68-
if visibility.node.is_pub();
69-
then {
70-
return;
71-
}
66+
match fn_kind {
67+
FnKind::ItemFn(.., visibility, _) if visibility.node.is_pub() => return,
68+
FnKind::Closure(..) => return,
69+
_ => (),
7270
}
7371

7472
let (return_type, path) = if is_type_diagnostic_item(cx, return_ty(cx, hir_id), sym!(option_type)) {

0 commit comments

Comments
 (0)