mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
Make lint skip closures
This commit is contained in:
parent
8392bc7946
commit
2f85aa736e
1 changed files with 4 additions and 6 deletions
|
@ -63,12 +63,10 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryWrap {
|
|||
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)) {
|
||||
|
|
Loading…
Reference in a new issue