use super::utils::{get_arg_name, match_var, remove_blocks, snippet, span_lint_and_sugg};
use rustc::hir::*;
use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
+use if_chain::if_chain;
/// **What it does:** Checks for matches being used to destructure a single-variant enum
/// or tuple struct where a `let` will suffice.
fn check_local(&mut self, cx: &LateContext<'a, 'tcx>, local: &'tcx Local) {
if_chain! {
if let Some(ref expr) = local.init;
- if let Expr_::ExprMatch(ref target, ref arms, MatchSource::Normal) = expr.node;
+ if let ExprKind::Match(ref target, ref arms, MatchSource::Normal) = expr.node;
if arms.len() == 1 && arms[0].pats.len() == 1 && arms[0].guard.is_none();
if let PatKind::TupleStruct(QPath::Resolved(None, ref variant_name), ref args, _) = arms[0].pats[0].node;
if args.len() == 1;