mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-01 00:49:30 +00:00
Apply needless_return
suggestions
This commit is contained in:
parent
b885035ef7
commit
678dcdd2be
1 changed files with 2 additions and 2 deletions
|
@ -97,7 +97,7 @@ pub(super) fn check<'tcx>(
|
||||||
let func_snippet = snippet(cx, map_arg.span, "..");
|
let func_snippet = snippet(cx, map_arg.span, "..");
|
||||||
let msg = "called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling \
|
let msg = "called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling \
|
||||||
`and_then(..)` instead";
|
`and_then(..)` instead";
|
||||||
return span_lint_and_sugg(
|
span_lint_and_sugg(
|
||||||
cx,
|
cx,
|
||||||
OPTION_MAP_OR_NONE,
|
OPTION_MAP_OR_NONE,
|
||||||
expr.span,
|
expr.span,
|
||||||
|
@ -110,7 +110,7 @@ pub(super) fn check<'tcx>(
|
||||||
let msg = "called `map_or(None, Some)` on a `Result` value. This can be done more directly by calling \
|
let msg = "called `map_or(None, Some)` on a `Result` value. This can be done more directly by calling \
|
||||||
`ok()` instead";
|
`ok()` instead";
|
||||||
let self_snippet = snippet(cx, recv.span, "..");
|
let self_snippet = snippet(cx, recv.span, "..");
|
||||||
return span_lint_and_sugg(
|
span_lint_and_sugg(
|
||||||
cx,
|
cx,
|
||||||
RESULT_MAP_OR_INTO_OPTION,
|
RESULT_MAP_OR_INTO_OPTION,
|
||||||
expr.span,
|
expr.span,
|
||||||
|
|
Loading…
Reference in a new issue