Skip to content

Commit

Permalink
Auto merge of rust-lang#9022 - alex-semenyuk:needless_option_take_mor…
Browse files Browse the repository at this point in the history
…e_docs, r=Jarcho

`NEEDLESS_OPTION_TAKE` doc improvements

changelog: More info on `NEEDLESS_OPTION_TAKE`
  • Loading branch information
bors committed Jul 17, 2022
2 parents 4562dd0 + e780435 commit 3a4e457
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2222,8 +2222,12 @@ declare_clippy_lint! {
}

declare_clippy_lint! {
/// ### What it does
/// Checks for calling `take` function after `as_ref`.
///
/// ### Why is this bad?
/// Redundant code. `take` writes `None` to its argument.
/// In this case the modification is useless as it's a temporary that cannot be read from afterwards.
///
/// ### Example
/// ```rust
Expand Down

0 comments on commit 3a4e457

Please sign in to comment.