Skip to content

Commit 0a30fdc

Browse files
committed
move the let statement out of the macro
1 parent 300282c commit 0a30fdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/methods/option_map_or_none.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ pub(super) fn check<'tcx>(
7474
let self_snippet = snippet(cx, recv.span, "..");
7575
if let hir::ExprKind::Closure(_, _, id, span, _) = map_arg.kind {
7676
let arg_snippet = snippet(cx, span, "..");
77+
let body = cx.tcx.hir().body(id);
7778
if_chain! {
78-
let body = cx.tcx.hir().body(id);
7979
if let Some((func, arg_char)) = reduce_unit_expression(cx, &body.value);
8080
if arg_char.len() == 1;
8181
if let hir::ExprKind::Path(ref qpath) = func.kind;

0 commit comments

Comments
 (0)