RU version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
100% Positive
Analyzed from 200 words in the discussion.
Trending Topics
#clippy#rust#run#box#things#linter#different#variant#doesn#actually

Discussion (6 Comments)Read Original on HackerNews
Clippy is essentially a linter; and one of its checks catches cases where different enum variants have a significantly different size; with a suggestion to Box the larger variant.
Since this is just a linter, it doesn't actually have any knowledge of how frequently each variant is actually used. It also doesn't address the situation in the article at all.
Without that, if you try to suggest a transformation like this when the schema is first conceived, it will likely be considered premature optimization.