mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Rollup merge of #116625 - nnethercote:rustc_hir_pretty, r=fee1-dead
`rustc_hir_pretty` cleanups Just some improvements I found while looking through this code. r? ``@fee1-dead``
This commit is contained in:
commit
0b8495b6ac
2 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
for arm in arms {
|
||||
if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind {
|
||||
let path_str = rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false));
|
||||
let path_str = rustc_hir_pretty::qpath_to_string(path);
|
||||
if path_str == "Err" {
|
||||
let mut matching_wild = inner.iter().any(is_wild);
|
||||
let mut ident_bind_name = kw::Underscore;
|
||||
|
|
|
@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
|
|||
cx,
|
||||
arguments.iter().collect(),
|
||||
cx.typeck_results().expr_ty(fn_expr),
|
||||
&rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false)),
|
||||
&rustc_hir_pretty::qpath_to_string(path),
|
||||
"function",
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue