Skip to content

Commit 5d54fbb

Browse files
committed
result_map_or_into_option: fix syntax error in example
1 parent 325d0b6 commit 5d54fbb

File tree

1 file changed

+7
-4
lines changed
  • clippy_lints/src/methods

1 file changed

+7
-4
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,16 @@ declare_clippy_lint! {
339339
/// **Known problems:** None.
340340
///
341341
/// **Example:**
342+
///
343+
/// Bad:
342344
/// ```rust
343-
/// # Bad
344-
/// let r: Result<u32, &str> = Ok(1);
345+
/// # let r: Result<u32, &str> = Ok(1);
345346
/// assert_eq!(Some(1), r.map_or(None, Some));
347+
/// ```
346348
///
347-
/// # Good
348-
/// let r: Result<u32, &str> = Ok(1);
349+
/// Good:
350+
/// ```rust
351+
/// # let r: Result<u32, &str> = Ok(1);
349352
/// assert_eq!(Some(1), r.ok());
350353
/// ```
351354
pub RESULT_MAP_OR_INTO_OPTION,

0 commit comments

Comments
 (0)