RS.CLIPPY.RESULT_MAP_OR_INTO_OPTION

Using `Result.map_or(None, Some)`, which is more succinctly expressed as `ok()`

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: result_map_or_into_option. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for usage of _.map_or(None, Some).

Why is this bad?

Readability, this can be written more concisely as _.ok().

Example

assert_eq!(Some(1), r.map_or(None, Some));

Use instead:

assert_eq!(Some(1), r.ok());