@@ -291,7 +291,7 @@ declare_clippy_lint! {
291
291
/// **What it does:** Checks for usage of `result.map(_).unwrap_or_else(_)`.
292
292
///
293
293
/// **Why is this bad?** Readability, this can be written more concisely as
294
- /// `result.ok(). map_or_else(_, _)`.
294
+ /// `result.map_or_else(_, _)`.
295
295
///
296
296
/// **Known problems:** None.
297
297
///
@@ -303,7 +303,7 @@ declare_clippy_lint! {
303
303
/// ```
304
304
pub RESULT_MAP_UNWRAP_OR_ELSE ,
305
305
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)`"
307
307
}
308
308
309
309
declare_clippy_lint ! {
@@ -2217,7 +2217,7 @@ fn lint_map_unwrap_or_else<'a, 'tcx>(
2217
2217
`map_or_else(g, f)` instead"
2218
2218
} else {
2219
2219
"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"
2221
2221
} ;
2222
2222
// get snippets for args to map() and unwrap_or_else()
2223
2223
let map_snippet = snippet ( cx, map_args[ 1 ] . span , ".." ) ;
@@ -2238,10 +2238,8 @@ fn lint_map_unwrap_or_else<'a, 'tcx>(
2238
2238
msg,
2239
2239
expr. span ,
2240
2240
& 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,
2245
2243
) ,
2246
2244
) ;
2247
2245
} else if same_span && multiline {
0 commit comments