Skip to content

Commit 988b08b

Browse files
committed
fix warning ty::tykind usage
1 parent 3986a01 commit 988b08b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/manual_unwrap_or_default.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc_errors::Applicability;
22
use rustc_hir::def::Res;
33
use rustc_hir::{Arm, Expr, ExprKind, HirId, LangItem, MatchSource, Pat, PatKind, QPath};
44
use rustc_lint::{LateContext, LateLintPass, LintContext};
5-
use rustc_middle::ty::{GenericArgKind, TyKind};
5+
use rustc_middle::ty::{self, GenericArgKind};
66
use rustc_session::declare_lint_pass;
77
use rustc_span::sym;
88

@@ -154,7 +154,7 @@ fn handle<'tcx>(cx: &LateContext<'tcx>, if_let_or_match: IfLetOrMatch<'tcx>, exp
154154

155155
// We check if the expression is not a method or function with a unspecified return type
156156
if let ExprKind::MethodCall(_, expr, _, _) = &condition.kind {
157-
if let TyKind::Adt(_, substs) = cx.typeck_results().expr_ty(expr).kind() {
157+
if let ty::Adt(_, substs) = cx.typeck_results().expr_ty(expr).kind() {
158158
if let Some(ok_type) = substs.get(0) {
159159
if let Some(receiver) = Sugg::hir_opt(cx, condition).map(Sugg::maybe_par) {
160160
return span_lint_and_sugg(

0 commit comments

Comments
 (0)