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
clippy version: clippy 0.0.212 (d342cee 2020-04-07) (installed via rustup)
First of all, this lint seems useful, thanks for adding it.
I recently run this lint on my code base and it reported this warning:
warning: large size difference between variants
--> libtiny_client/src/stream.rs:35:5
|
35 | TlsStream(TlsStream<TcpStream>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::large_enum_variant)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
help: consider boxing the large fields to reduce the total size of the enum
|
35 | TlsStream(Box<TlsStream<TcpStream>>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
The first question I asked when I see this is "OK, but how much is the difference, and what is the sizes of variants currently". I think this information is useful to decide whether to box the variant or not. For example, if one variant is one word and the other is 5, I probably wouldn't refactor this as 5 words is still not large enough for my purposes. But if one is one word and the other is 100 words then this is probably with refactoring.
I checked the link in the warning message, but couldn't see anything about when is a variant considered too different than others.
The text was updated successfully, but these errors were encountered:
clippy version: clippy 0.0.212 (d342cee 2020-04-07) (installed via rustup)
First of all, this lint seems useful, thanks for adding it.
I recently run this lint on my code base and it reported this warning:
The first question I asked when I see this is "OK, but how much is the difference, and what is the sizes of variants currently". I think this information is useful to decide whether to box the variant or not. For example, if one variant is one word and the other is 5, I probably wouldn't refactor this as 5 words is still not large enough for my purposes. But if one is one word and the other is 100 words then this is probably with refactoring.
I checked the link in the warning message, but couldn't see anything about when is a variant considered too different than others.
The text was updated successfully, but these errors were encountered: