Skip to content

Commit 8a14c11

Browse files
committed
Cleanup, explain return value
1 parent d71b418 commit 8a14c11

File tree

1 file changed

+5
-6
lines changed
  • clippy_lints/src/methods

1 file changed

+5
-6
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,6 +2711,7 @@ fn lint_map_flatten<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, map
27112711
}
27122712

27132713
/// lint use of `map().unwrap_or_else()` for `Option`s and `Result`s
2714+
/// Return true if lint triggered
27142715
fn lint_map_unwrap_or_else<'tcx>(
27152716
cx: &LateContext<'tcx>,
27162717
expr: &'tcx hir::Expr<'_>,
@@ -2761,16 +2762,14 @@ fn lint_map_unwrap_or_else<'tcx>(
27612762
map_snippet, unwrap_snippet,
27622763
),
27632764
);
2764-
true
2765+
return true;
27652766
} else if same_span && multiline {
27662767
span_lint(cx, MAP_UNWRAP_OR, expr.span, msg);
2767-
true
2768-
} else {
2769-
false
2768+
return true;
27702769
}
2771-
} else {
2772-
false
27732770
}
2771+
2772+
false
27742773
}
27752774

27762775
/// lint use of `_.map_or(None, _)` for `Option`s and `Result`s

0 commit comments

Comments
 (0)