-use crate::utils::{is_type_diagnostic_item, span_lint_and_help, SpanlessEq};
+use clippy_utils::diagnostics::span_lint_and_help;
+use clippy_utils::ty::is_type_diagnostic_item;
+use clippy_utils::SpanlessEq;
use if_chain::if_chain;
use rustc_hir::intravisit::{self as visit, NestedVisitorMap, Visitor};
use rustc_hir::{Expr, ExprKind, MatchSource};
cx,
};
if let ExprKind::Match(
- ref op,
- ref arms,
+ op,
+ arms,
MatchSource::IfLetDesugar {
contains_else_clause: true,
},
{
op_visit.visit_expr(op);
if op_visit.mutex_lock_called {
- for arm in *arms {
+ for arm in arms {
arm_visit.visit_arm(arm);
}
type Map = Map<'tcx>;
fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
- if_chain! {
- if let Some(mutex) = is_mutex_lock_call(self.cx, expr);
- then {
- self.found_mutex = Some(mutex);
- self.mutex_lock_called = true;
- return;
- }
+ if let Some(mutex) = is_mutex_lock_call(self.cx, expr) {
+ self.found_mutex = Some(mutex);
+ self.mutex_lock_called = true;
+ return;
}
visit::walk_expr(self, expr);
}
type Map = Map<'tcx>;
fn visit_expr(&mut self, expr: &'tcx Expr<'tcx>) {
- if_chain! {
- if let Some(mutex) = is_mutex_lock_call(self.cx, expr);
- then {
- self.found_mutex = Some(mutex);
- self.mutex_lock_called = true;
- return;
- }
+ if let Some(mutex) = is_mutex_lock_call(self.cx, expr) {
+ self.found_mutex = Some(mutex);
+ self.mutex_lock_called = true;
+ return;
}
visit::walk_expr(self, expr);
}