Skip to content

Commit aad8e69

Browse files
committed
Fix unwrap.rs
1 parent 747f79e commit aad8e69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/unwrap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use if_chain::if_chain;
22
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
33
use rustc::{declare_lint_pass, declare_tool_lint};
44

5-
use crate::utils::{in_macro, match_type, paths, span_lint_and_then, usage::is_potentially_mutated};
5+
use crate::utils::{higher::if_block, in_macro, match_type, paths, span_lint_and_then, usage::is_potentially_mutated};
66
use rustc::hir::intravisit::*;
77
use rustc::hir::*;
88
use syntax::source_map::Span;
@@ -130,7 +130,7 @@ impl<'a, 'tcx: 'a> UnwrappableVariablesVisitor<'a, 'tcx> {
130130

131131
impl<'a, 'tcx: 'a> Visitor<'tcx> for UnwrappableVariablesVisitor<'a, 'tcx> {
132132
fn visit_expr(&mut self, expr: &'tcx Expr) {
133-
if let ExprKind::If(cond, then, els) = &expr.node {
133+
if let Some((cond, then, els)) = if_block(&expr) {
134134
walk_expr(self, cond);
135135
self.visit_branch(cond, then, false);
136136
if let Some(els) = els {

0 commit comments

Comments
 (0)