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
While it is sometimes clearer to use .., it is also often the case to want to make sure that a compilation-error will be produced if a pattern changes. Using .. silences these errors.
It is not clear to me that either direction is better than the other.
I think a middle ground could be to have two lints, one for types defined inside the crate, and one for types defined by extern crates. For extern crates, we should not suggest using ...
For types defined within the same crate, I still don't think that .. is always better than fully matching all fields. It depends on what you are trying to do.
The text was updated successfully, but these errors were encountered:
While it is sometimes clearer to use
..
, it is also often the case to want to make sure that a compilation-error will be produced if a pattern changes. Using..
silences these errors.It is not clear to me that either direction is better than the other.
The docs (https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern) do not mention a single case in which one might want to not use
..
, suggesting that the obvious choice is to always use it.I think a middle ground could be to have two lints, one for types defined inside the crate, and one for types defined by extern crates. For extern crates, we should not suggest using
..
.For types defined within the same crate, I still don't think that
..
is always better than fully matching all fields. It depends on what you are trying to do.The text was updated successfully, but these errors were encountered: