mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
panic at map_unit_fn.rs:202 for map() without args
This commit is contained in:
parent
80c07d4c28
commit
c6031221e0
1 changed files with 1 additions and 1 deletions
|
@ -199,7 +199,6 @@ fn suggestion_msg(function_type: &str, map_type: &str) -> String {
|
|||
|
||||
fn lint_map_unit_fn(cx: &LateContext<'_, '_>, stmt: &hir::Stmt, expr: &hir::Expr, map_args: &[hir::Expr]) {
|
||||
let var_arg = &map_args[0];
|
||||
let fn_arg = &map_args[1];
|
||||
|
||||
let (map_type, variant, lint) = if match_type(cx, cx.tables.expr_ty(var_arg), &paths::OPTION) {
|
||||
("Option", "Some", OPTION_MAP_UNIT_FN)
|
||||
|
@ -208,6 +207,7 @@ fn lint_map_unit_fn(cx: &LateContext<'_, '_>, stmt: &hir::Stmt, expr: &hir::Expr
|
|||
} else {
|
||||
return;
|
||||
};
|
||||
let fn_arg = &map_args[1];
|
||||
|
||||
if is_unit_function(cx, fn_arg) {
|
||||
let msg = suggestion_msg("function", map_type);
|
||||
|
|
Loading…
Add table
Reference in a new issue