Expand on misrefactored_assign_op known problems

This commit is contained in:
Dale Wijnand 2018-07-24 08:39:18 +01:00
parent 1f65617372
commit 6ad7a92ff8
No known key found for this signature in database
GPG key ID: 4F256E3D151DF5EF

View file

@ -51,8 +51,10 @@ declare_clippy_lint! {
/// **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 then
/// rewrite it as `a = (2 * a) op b` as it's less confusing.
///
/// **Example:**
/// ```rust