large size difference between variants
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- rust
- Domain
- networking
Research direction
Start in sable_network/src/network/update.rs at the HistoricMessageSource and HistoricMessageTarget definitions, then run Clippy to reproduce the two large_enum_variant warnings. Inspect the affected enum usages before applying the suggested boxing approach; done means the warnings no longer appear and the project still builds.
Written by the indexing model from the issue text.
Description
Clippy points out these issues:
warning: large size difference between variants
--> sable_network/src/network/update.rs:34:1
|
34 | / pub enum HistoricMessageSource {
35 | | Server(state::Server),
| | --------------------- the second-largest variant contains at least 128 bytes
36 | | User(HistoricUser),
| | ------------------ the largest variant contains at least 656 bytes
37 | | Unknown,
38 | | }
| |_^ the entire enum is at least 656 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
|
36 | User(Box<HistoricUser>),
| ~~~~~~~~~~~~~~~~~
warning: large size difference between variants
--> sable_network/src/network/update.rs:54:1
|
54 | / pub enum HistoricMessageTarget {
55 | | User(HistoricUser),
| | ------------------ the largest variant contains at least 656 bytes
56 | | Channel(state::Channel),
| | ----------------------- the second-largest variant contains at least 176 bytes
57 | | Unknown,
58 | | }
| |_^ the entire enum is at least 656 bytes
|
= 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
|
55 | User(Box<HistoricUser>),
| ~~~~~~~~~~~~~~~~~
warning: `sable_network` (lib) generated 2 warnings
Should we do something about them?
- Dominant language
- Rust
- Stars
- 132
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Libera-Chat/sable
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Libera-Chat/sable#178 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Libera-Chat/sable#172 ·
-
Rate limiting Open
Difficulty 5/5 Over a week Newbie friendliness 30/100
Libera-Chat/sable#170 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Libera-Chat/sable#169 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Libera-Chat/sable#156 · 1 comment ·
All issues in Libera-Chat/sable
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100