Fix pattern match of ExprKind::MethodCall

This commit is contained in:
Teddy_Wang 2020-06-23 11:40:38 -04:00
parent 40ee620e51
commit fb4f9a0ad7

View File

@ -61,7 +61,7 @@ fn check_expr(&mut self, cx: &LateContext<'_, '_>, expr: &Expr<'_>) {
/// map(). Otherwise, returns None.
fn get_map_argument<'a>(cx: &LateContext<'_, '_>, expr: &'a Expr<'a>) -> Option<&'a [Expr<'a>]> {
if_chain! {
if let ExprKind::MethodCall(ref method, _, ref args) = expr.kind;
if let ExprKind::MethodCall(ref method, _, ref args, _) = expr.kind;
if args.len() == 2 && method.ident.as_str() == "map";
let caller_ty = cx.tables.expr_ty(&args[0]);
if match_trait_method(cx, expr, &paths::ITERATOR)