You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@camsteffen You used Vec::with_capacity in your example function, but if you only try debug print like this, it compiles with no warning about a = b = c;.
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 toa = 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)
Drawbacks
None.
Example
a = b = c;
Could be written as:
Or the programmer might have intended:
The text was updated successfully, but these errors were encountered: