Skip to content

Commit abe480f

Browse files
committed
Fix if_chain
1 parent a76bb59 commit abe480f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

clippy_lints/src/undocumented_unsafe_blocks.rs

+10-11
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,22 @@ impl LateLintPass<'_> for UndocumentedUnsafeBlocks {
6161
if !in_external_macro(cx.tcx.sess, block.span);
6262
if let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules;
6363
if let Some(enclosing_scope_hir_id) = cx.tcx.hir().get_enclosing_scope(block.hir_id);
64+
if block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, block.span) == Some(false);
6465
then {
65-
if block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, block.span) == Some(false) {
66-
let mut span = block.span;
66+
let mut span = block.span;
6767

68-
if let Some(local_span) = self.local_span {
69-
span = local_span;
68+
if let Some(local_span) = self.local_span {
69+
span = local_span;
7070

71-
let result = block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, span);
71+
let result = block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, span);
7272

73-
if result == Some(true) || result.is_none() {
74-
self.local_checked = true;
75-
return;
76-
}
73+
if result == Some(true) || result.is_none() {
74+
self.local_checked = true;
75+
return;
7776
}
78-
79-
err(cx, span);
8077
}
78+
79+
err(cx, span);
8180
}
8281
}
8382
}

0 commit comments

Comments
 (0)