Skip to content

Commit feca48d

Browse files
committed
Fix doc tests
1 parent 7a73b8f commit feca48d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/unwrap.rs

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ declare_clippy_lint! {
1818
///
1919
/// **Example:**
2020
/// ```rust
21+
/// # let option = Some(0);
22+
/// # fn do_something_with(_x: usize) {}
2123
/// if option.is_some() {
2224
/// do_something_with(option.unwrap())
2325
/// }
@@ -26,6 +28,8 @@ declare_clippy_lint! {
2628
/// Could be written:
2729
///
2830
/// ```rust
31+
/// # let option = Some(0);
32+
/// # fn do_something_with(_x: usize) {}
2933
/// if let Some(value) = option {
3034
/// do_something_with(value)
3135
/// }
@@ -45,6 +49,8 @@ declare_clippy_lint! {
4549
///
4650
/// **Example:**
4751
/// ```rust
52+
/// # let option = Some(0);
53+
/// # fn do_something_with(_x: usize) {}
4854
/// if option.is_none() {
4955
/// do_something_with(option.unwrap())
5056
/// }

0 commit comments

Comments
 (0)