fn result_error_type<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
if_chain! {
if let ty::Adt(_, subst) = ty.kind();
- if is_type_diagnostic_item(cx, ty, sym::result_type);
+ if is_type_diagnostic_item(cx, ty, sym::Result);
then {
Some(subst.type_at(1))
} else {
let ready_ty = subst.type_at(0);
if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
- if cx.tcx.is_diagnostic_item(sym::result_type, ready_def.did);
+ if cx.tcx.is_diagnostic_item(sym::Result, ready_def.did);
then {
Some(ready_subst.type_at(1))
} else {
let ready_ty = subst.type_at(0);
if let ty::Adt(ready_def, ready_subst) = ready_ty.kind();
- if cx.tcx.is_diagnostic_item(sym::option_type, ready_def.did);
+ if cx.tcx.is_diagnostic_item(sym::Option, ready_def.did);
let some_ty = ready_subst.type_at(0);
if let ty::Adt(some_def, some_subst) = some_ty.kind();
- if cx.tcx.is_diagnostic_item(sym::result_type, some_def.did);
+ if cx.tcx.is_diagnostic_item(sym::Result, some_def.did);
then {
Some(some_subst.type_at(1))
} else {