Skip to content

Commit

Permalink
fix arguments of ExprKind::MethodCall (rust-lang#13890)
Browse files Browse the repository at this point in the history
changelog: none
  • Loading branch information
flip1995 authored Dec 28, 2024
2 parents a8968e5 + 09022bb commit 998c780
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion book/src/development/method_checking.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use clippy_utils::is_trait_method;
impl<'tcx> LateLintPass<'tcx> for OurFancyMethodLint {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
// Check our expr is calling a method with pattern matching
if let hir::ExprKind::MethodCall(path, _, [self_arg, ..]) = &expr.kind
if let hir::ExprKind::MethodCall(path, _, [self_arg, ..], _) = &expr.kind
// Check if the name of this method is `our_fancy_method`
&& path.ident.name.as_str() == "our_fancy_method"
// We can check the type of the self argument whenever necessary.
Expand Down

0 comments on commit 998c780

Please sign in to comment.