- let (map_type, variant, lint) = if match_type(cx, cx.tables.expr_ty(var_arg), &paths::OPTION) {
- ("Option", "Some", OPTION_MAP_UNIT_FN)
- } else if match_type(cx, cx.tables.expr_ty(var_arg), &paths::RESULT) {
- ("Result", "Ok", RESULT_MAP_UNIT_FN)
- } else {
- return;
- };
+ let (map_type, variant, lint) =
+ if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(var_arg), sym::option_type) {
+ ("Option", "Some", OPTION_MAP_UNIT_FN)
+ } else if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(var_arg), sym::result_type) {
+ ("Result", "Ok", RESULT_MAP_UNIT_FN)
+ } else {
+ return;
+ };