Fix clippy

This commit is contained in:
Michael Goulet 2024-04-14 11:04:18 -04:00
parent 9d72808b1e
commit 2beb6a4782
3 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: &Msrv) {
let (help, final_suggestion) = if let Some(method) = omit_cast.corresponding_item() { let (help, final_suggestion) = if let Some(method) = omit_cast.corresponding_item() {
// don't force absolute path // don't force absolute path
let method = qpath_to_string(method); let method = qpath_to_string(&cx.tcx, method);
("try call directly", format!("{method}{turbofish}()")) ("try call directly", format!("{method}{turbofish}()"))
} else { } else {
let cast_expr_sugg = Sugg::hir_with_applicability(cx, cast_expr, "_", &mut app); let cast_expr_sugg = Sugg::hir_with_applicability(cx, cast_expr, "_", &mut app);

View File

@ -19,7 +19,7 @@ pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'tcx>, arms: &[Arm<'
if is_type_diagnostic_item(cx, ex_ty, sym::Result) { if is_type_diagnostic_item(cx, ex_ty, sym::Result) {
for arm in arms { for arm in arms {
if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind { if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind {
let path_str = rustc_hir_pretty::qpath_to_string(path); let path_str = rustc_hir_pretty::qpath_to_string(&cx.tcx, path);
if path_str == "Err" { if path_str == "Err" {
let mut matching_wild = inner.iter().any(is_wild); let mut matching_wild = inner.iter().any(is_wild);
let mut ident_bind_name = kw::Underscore; let mut ident_bind_name = kw::Underscore;

View File

@ -49,7 +49,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
cx, cx,
arguments.iter().collect(), arguments.iter().collect(),
cx.typeck_results().expr_ty(fn_expr), cx.typeck_results().expr_ty(fn_expr),
&rustc_hir_pretty::qpath_to_string(path), &rustc_hir_pretty::qpath_to_string(&cx.tcx, path),
"function", "function",
); );
} }