Skip to content

Commit 332c2dc

Browse files
committed
Fix dogfood after MatchTypeOnDiagItem
1 parent 8afa7ed commit 332c2dc

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clippy_lints/src/loops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ fn get_vec_push<'tcx>(cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) -> Option<(&
11141114
if let Some(self_expr) = args.get(0);
11151115
if let Some(pushed_item) = args.get(1);
11161116
// Check that the method being called is push() on a Vec
1117-
if match_type(cx, cx.typeck_results().expr_ty(self_expr), &paths::VEC);
1117+
if is_type_diagnostic_item(cx, cx.typeck_results().expr_ty(self_expr), sym!(vec_type));
11181118
if path.ident.name.as_str() == "push";
11191119
then {
11201120
return Some((self_expr, pushed_item))

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ fn lint_or_fun_call<'tcx>(
18081808
_ => (),
18091809
}
18101810

1811-
if match_type(cx, ty, &paths::VEC) {
1811+
if is_type_diagnostic_item(cx, ty, sym!(vec_type)) {
18121812
return;
18131813
}
18141814
}

clippy_lints/src/option_if_let_else.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::utils;
22
use crate::utils::sugg::Sugg;
3-
use crate::utils::{match_type, paths, span_lint_and_sugg};
3+
use crate::utils::{is_type_diagnostic_item, paths, span_lint_and_sugg};
44
use if_chain::if_chain;
55

66
use rustc_errors::Applicability;
@@ -73,7 +73,7 @@ declare_lint_pass!(OptionIfLetElse => [OPTION_IF_LET_ELSE]);
7373
fn is_result_ok(cx: &LateContext<'_>, expr: &'_ Expr<'_>) -> bool {
7474
if let ExprKind::MethodCall(ref path, _, &[ref receiver], _) = &expr.kind {
7575
path.ident.name.to_ident_string() == "ok"
76-
&& match_type(cx, &cx.typeck_results().expr_ty(&receiver), &paths::RESULT)
76+
&& is_type_diagnostic_item(cx, &cx.typeck_results().expr_ty(&receiver), sym!(result_type))
7777
} else {
7878
false
7979
}

0 commit comments

Comments
 (0)