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 3, 2021
1 parent f3934ed commit 670e2a1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions clippy_lints/src/undocumented_unsafe_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ enum ErrorKind {

impl LateLintPass<'_> for UndocumentedUnsafeBlocks {
fn check_block(&mut self, cx: &LateContext<'_>, block: &'_ Block<'_>) {
if self.local_level == 0 {
if_chain! {
if !is_lint_allowed(cx, UNDOCUMENTED_UNSAFE_BLOCKS, block.hir_id);
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);
then {
find_candidate(cx, block.span, enclosing_scope_hir_id)
}
if_chain! {
if self.local_level == 0;
if !is_lint_allowed(cx, UNDOCUMENTED_UNSAFE_BLOCKS, block.hir_id);
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);
then {
find_candidate(cx, block.span, enclosing_scope_hir_id)
}
}
}
Expand Down

0 comments on commit 670e2a1

Please sign in to comment.