Merge nested if into adjacent if_let_chain!
This commit is contained in:
@@ -187,9 +187,9 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool) {
|
||||
match ty.node {
|
||||
TyPath(ref qpath) => {
|
||||
let def = cx.tables.qpath_def(qpath, ast_ty.id);
|
||||
if let Some(def_id) = opt_def_id(def) {
|
||||
if Some(def_id) == cx.tcx.lang_items.owned_box() {
|
||||
if_let_chain! {[
|
||||
let Some(def_id) = opt_def_id(def),
|
||||
Some(def_id) == cx.tcx.lang_items.owned_box(),
|
||||
let QPath::Resolved(None, ref path) = *qpath,
|
||||
let [ref bx] = *path.segments,
|
||||
let PathParameters::AngleBracketedParameters(ref ab_data) = bx.parameters,
|
||||
@@ -217,8 +217,6 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool) {
|
||||
);
|
||||
return; // don't recurse into the type
|
||||
}};
|
||||
}
|
||||
}
|
||||
check_ty(cx, ty, is_local);
|
||||
},
|
||||
_ => check_ty(cx, ty, is_local),
|
||||
|
||||
Reference in New Issue
Block a user