Skip to content

Commit 359fa98

Browse files
committed
Rejig some top-level rustc_hir_pretty functions.
There are several that are unused and can be removed. And there are some calls to `to_string`, which can be expressed more nicely as a `foo_to_string` call, and then `to_string` need not be `pub`. (This requires adding `pat_to_string`).
1 parent 56400a0 commit 359fa98

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/matches/match_wild_err_arm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'tcx>, arms: &[Arm<'
1919
if is_type_diagnostic_item(cx, ex_ty, sym::Result) {
2020
for arm in arms {
2121
if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind {
22-
let path_str = rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false));
22+
let path_str = rustc_hir_pretty::qpath_to_string(path);
2323
if path_str == "Err" {
2424
let mut matching_wild = inner.iter().any(is_wild);
2525
let mut ident_bind_name = kw::Underscore;

clippy_lints/src/mut_reference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
4949
cx,
5050
arguments.iter().collect(),
5151
cx.typeck_results().expr_ty(fn_expr),
52-
&rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false)),
52+
&rustc_hir_pretty::qpath_to_string(path),
5353
"function",
5454
);
5555
}

0 commit comments

Comments
 (0)