Skip to content

Commit 4a5f4fa

Browse files
committed
Rename have_chain_method to is_in_method_chain for clarity and update its usage in the lint pass.
1 parent 66442b9 commit 4a5f4fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/dereference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> {
305305
RefOp::Method { mutbl, is_ufcs }
306306
if !is_lint_allowed(cx, EXPLICIT_DEREF_METHODS, expr.hir_id)
307307
// Allow explicit deref in method chains. e.g. `foo.deref().bar()`
308-
&& (is_ufcs || !have_chain_method(cx, expr)) =>
308+
&& (is_ufcs || !is_in_method_chain(cx, expr)) =>
309309
{
310310
let ty_changed_count = usize::from(!deref_method_same_type(expr_ty, typeck.expr_ty(sub_expr)));
311311
self.state = Some((
@@ -728,7 +728,7 @@ fn deref_method_same_type<'tcx>(result_ty: Ty<'tcx>, arg_ty: Ty<'tcx>) -> bool {
728728
}
729729
}
730730

731-
fn have_chain_method<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> bool {
731+
fn is_in_method_chain<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> bool {
732732
if let ExprKind::MethodCall(_, child, _, _) = e.kind {
733733
match child.kind {
734734
ExprKind::MethodCall(..)

0 commit comments

Comments
 (0)