Skip to content

Commit 0651096

Browse files
committed
Improve method chain detection in is_in_method_chain
1 parent 6d15430 commit 0651096

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/dereference.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,9 @@ fn deref_method_same_type<'tcx>(result_ty: Ty<'tcx>, arg_ty: Ty<'tcx>) -> bool {
729729
}
730730

731731
fn is_in_method_chain<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> bool {
732-
if matches!(e.kind, ExprKind::MethodCall(_, recv, _, _) if matches!(recv.kind, ExprKind::MethodCall(..))) {
732+
if let ExprKind::MethodCall(_, recv, _, _) = e.kind
733+
&& matches!(recv.kind, ExprKind::MethodCall(..))
734+
{
733735
return true;
734736
}
735737

0 commit comments

Comments
 (0)