mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Fix doc tests
This commit is contained in:
parent
7a73b8fdfa
commit
feca48d8a2
1 changed files with 6 additions and 0 deletions
|
@ -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())
|
||||
/// }
|
||||
|
|
Loading…
Add table
Reference in a new issue