mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
result_map_or_into_option: fix syntax error in example
This commit is contained in:
parent
325d0b69d2
commit
5d54fbb791
1 changed files with 9 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue