]> git.lizzy.rs Git - rust.git/commitdiff
Expand on misrefactored_assign_op known problems
authorDale Wijnand <dale.wijnand@gmail.com>
Tue, 24 Jul 2018 07:39:18 +0000 (08:39 +0100)
committerDale Wijnand <dale.wijnand@gmail.com>
Tue, 24 Jul 2018 07:39:18 +0000 (08:39 +0100)
clippy_lints/src/assign_ops.rs

index c2d0ccd1534e8835c88d39d2355cde3f0f3228b4..d61515d533f03d379f00365d6da70ad2cdde6488 100644 (file)
 /// **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