From feca48d8a292c66186fb391c231327b85e116cd9 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Thu, 1 Aug 2019 12:53:20 +0200 Subject: [PATCH] Fix doc tests --- clippy_lints/src/unwrap.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clippy_lints/src/unwrap.rs b/clippy_lints/src/unwrap.rs index c2fb62c3017d..d39c341d06e5 100644 --- a/clippy_lints/src/unwrap.rs +++ b/clippy_lints/src/unwrap.rs @@ -18,6 +18,8 @@ declare_clippy_lint! { /// /// **Example:** /// ```rust + /// # let option = Some(0); + /// # fn do_something_with(_x: usize) {} /// if option.is_some() { /// do_something_with(option.unwrap()) /// } @@ -26,6 +28,8 @@ declare_clippy_lint! { /// Could be written: /// /// ```rust + /// # let option = Some(0); + /// # fn do_something_with(_x: usize) {} /// if let Some(value) = option { /// do_something_with(value) /// } @@ -45,6 +49,8 @@ declare_clippy_lint! { /// /// **Example:** /// ```rust + /// # let option = Some(0); + /// # fn do_something_with(_x: usize) {} /// if option.is_none() { /// do_something_with(option.unwrap()) /// }