Merge pull request #2953 from dwijnand/misrefactored_assign_op-known-problem-doc
Expand on misrefactored_assign_op known problems
This commit is contained in:
commit
3f9b837ec8
@ -51,8 +51,10 @@
|
||||
/// **Why is this bad?** Most likely these are bugs where one meant to write `a
|
||||
/// op= b`.
|
||||
///
|
||||
/// **Known problems:** Someone might actually mean `a op= a op b`, but that
|
||||
/// should rather be written as `a = (2 * a) op b` where applicable.
|
||||
/// **Known problems:** Clippy cannot know for sure if `a op= a op b` should have
|
||||
/// been `a = a op a op b` or `a = a op b`/`a op= b`. Therefore it suggests both.
|
||||
/// If `a op= a op b` is really the correct behaviour it should be
|
||||
/// written as `a = a op a op b` as it's less confusing.
|
||||
///
|
||||
/// **Example:**
|
||||
/// ```rust
|
||||
|
Loading…
Reference in New Issue
Block a user