Skip to content

Commit

Permalink
Fix if_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Oct 4, 2021
1 parent a76bb59 commit abe480f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions clippy_lints/src/undocumented_unsafe_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,22 @@ impl LateLintPass<'_> for UndocumentedUnsafeBlocks {
if !in_external_macro(cx.tcx.sess, block.span);
if let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules;
if let Some(enclosing_scope_hir_id) = cx.tcx.hir().get_enclosing_scope(block.hir_id);
if block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, block.span) == Some(false);
then {
if block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, block.span) == Some(false) {
let mut span = block.span;
let mut span = block.span;

if let Some(local_span) = self.local_span {
span = local_span;
if let Some(local_span) = self.local_span {
span = local_span;

let result = block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, span);
let result = block_has_safety_comment(cx.tcx, enclosing_scope_hir_id, span);

if result == Some(true) || result.is_none() {
self.local_checked = true;
return;
}
if result == Some(true) || result.is_none() {
self.local_checked = true;
return;
}

err(cx, span);
}

err(cx, span);
}
}
}
Expand Down

0 comments on commit abe480f

Please sign in to comment.