Skip to content

Commit a94e968

Browse files
author
Yusuf Raji
committed
Check that map() receiver is the func param
1 parent 12e7cfa commit a94e968

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

clippy_lints/src/single_option_map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl<'tcx> LateLintPass<'tcx> for SingleOptionMap {
5555
&& method_name.ident.name == sym::map
5656
&& let callee_type = cx.typeck_results().expr_ty(callee)
5757
&& is_type_diagnostic_item(cx, callee_type, sym::Option)
58+
&& let ExprKind::Path(_path) = callee.kind
5859
{
5960
span_lint(
6061
cx,

0 commit comments

Comments
 (0)