Closed
Description
What it does
regarding to: https://stackoverflow.com/questions/65661530/why-can-assignment-operator-be-chained-in-rust
One might assume an assignment statement a = b = c;
to be equivalent to a = c; b = c;
, but it isn't.
There seems to be very few cases, if any, where we would intentionally write a = b = c;
.
It would be nice if clippy warned such an assignment.
Categories (optional)
- Kind: correctness
Drawbacks
None.
Example
a = b = c;
Could be written as:
b = c;
a = ();
Or the programmer might have intended:
a = c;
b = c;