@@ -291,7 +291,7 @@ declare_clippy_lint! {
291291 /// **What it does:** Checks for usage of `result.map(_).unwrap_or_else(_)`.
292292 ///
293293 /// **Why is this bad?** Readability, this can be written more concisely as
294- /// `result.ok(). map_or_else(_, _)`.
294+ /// `result.map_or_else(_, _)`.
295295 ///
296296 /// **Known problems:** None.
297297 ///
@@ -303,7 +303,7 @@ declare_clippy_lint! {
303303 /// ```
304304 pub RESULT_MAP_UNWRAP_OR_ELSE ,
305305 pedantic,
306- "using `Result.map(f).unwrap_or_else(g)`, which is more succinctly expressed as `.ok(). map_or_else(g, f)`"
306+ "using `Result.map(f).unwrap_or_else(g)`, which is more succinctly expressed as `.map_or_else(g, f)`"
307307}
308308
309309declare_clippy_lint ! {
@@ -2217,7 +2217,7 @@ fn lint_map_unwrap_or_else<'a, 'tcx>(
22172217 `map_or_else(g, f)` instead"
22182218 } else {
22192219 "called `map(f).unwrap_or_else(g)` on a Result value. This can be done more directly by calling \
2220- `ok() .map_or_else(g, f)` instead"
2220+ `.map_or_else(g, f)` instead"
22212221 } ;
22222222 // get snippets for args to map() and unwrap_or_else()
22232223 let map_snippet = snippet ( cx, map_args[ 1 ] . span , ".." ) ;
@@ -2238,10 +2238,8 @@ fn lint_map_unwrap_or_else<'a, 'tcx>(
22382238 msg,
22392239 expr. span ,
22402240 & format ! (
2241- "replace `map({0}).unwrap_or_else({1})` with `{2}map_or_else({1}, {0})`" ,
2242- map_snippet,
2243- unwrap_snippet,
2244- if is_result { "ok()." } else { "" }
2241+ "replace `map({0}).unwrap_or_else({1})` with `map_or_else({1}, {0})`" ,
2242+ map_snippet, unwrap_snippet,
22452243 ) ,
22462244 ) ;
22472245 } else if same_span && multiline {
0 commit comments