result_map_or_into_option: fix syntax error in example

This commit is contained in:
Nick Torres 2020-04-04 17:20:23 -07:00
parent 325d0b69d2
commit 5d54fbb791

View File

@ -339,13 +339,16 @@ declare_clippy_lint! {
/// **Known problems:** None.
///
/// **Example:**
/// ```rust
/// # Bad
/// let r: Result<u32, &str> = Ok(1);
/// assert_eq!(Some(1), r.map_or(None, Some));
///
/// # Good
/// let r: Result<u32, &str> = Ok(1);
/// Bad:
/// ```rust
/// # let r: Result<u32, &str> = Ok(1);
/// assert_eq!(Some(1), r.map_or(None, Some));
/// ```
///
/// Good:
/// ```rust
/// # let r: Result<u32, &str> = Ok(1);
/// assert_eq!(Some(1), r.ok());
/// ```
pub RESULT_MAP_OR_INTO_OPTION,