result_map_or_into_option: fix syntax error in example
This commit is contained in:
parent
325d0b69d2
commit
5d54fbb791
@ -339,13 +339,16 @@
|
||||
/// **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,
|
||||
|
Loading…
Reference in New Issue
Block a user