Skip to content

Commit 36ff2f7

Browse files
committed
Rename function
1 parent 85edd65 commit 36ff2f7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/matches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::utils::usage::is_unused;
44
use crate::utils::{
55
expr_block, get_arg_name, get_parent_expr, implements_trait, in_macro, indent_of, is_allowed, is_expn_of,
66
is_refutable, is_type_diagnostic_item, is_wild, match_qpath, match_type, match_var, meets_msrv, multispan_sugg,
7-
peel_hir_pat_refs, peel_mid_ty_refs, peeln_hir_expr_refs, remove_blocks, snippet, snippet_block, snippet_opt,
7+
peel_hir_pat_refs, peel_mid_ty_refs, peel_n_hir_expr_refs, remove_blocks, snippet, snippet_block, snippet_opt,
88
snippet_with_applicability, span_lint_and_help, span_lint_and_note, span_lint_and_sugg, span_lint_and_then,
99
};
1010
use crate::utils::{paths, search_same, SpanlessEq, SpanlessHash};
@@ -748,7 +748,7 @@ fn report_single_match_single_pattern(
748748
let ref_count_diff = ty_ref_count - pat_ref_count;
749749

750750
// Try to remove address of expressions first.
751-
let (ex, removed) = peeln_hir_expr_refs(ex, ref_count_diff);
751+
let (ex, removed) = peel_n_hir_expr_refs(ex, ref_count_diff);
752752
let ref_count_diff = ref_count_diff - removed;
753753

754754
let msg = "you seem to be trying to use `match` for an equality check. Consider using `if`";

clippy_lints/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ pub fn peel_hir_pat_refs(pat: &'a Pat<'a>) -> (&'a Pat<'a>, usize) {
16831683

16841684
/// Peels off up to the given number of references on the expression. Returns the underlying
16851685
/// expression and the number of references removed.
1686-
pub fn peeln_hir_expr_refs(expr: &'a Expr<'a>, count: usize) -> (&'a Expr<'a>, usize) {
1686+
pub fn peel_n_hir_expr_refs(expr: &'a Expr<'a>, count: usize) -> (&'a Expr<'a>, usize) {
16871687
fn f(expr: &'a Expr<'a>, count: usize, target: usize) -> (&'a Expr<'a>, usize) {
16881688
match expr.kind {
16891689
ExprKind::AddrOf(_, _, expr) if count != target => f(expr, count + 1, target),

0 commit comments

Comments
 (0)