Fix large enum variant
Maintainers usually reply within 1 day
@NichtNil5 is already working on this.
Since Sep 29, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- performance
Research direction
Start in src/connection/parser/message.rs at the Message enum around line 9, then search for its variants and usages to understand the required representation changes. Run Clippy before and after the change; done means the large_enum_variant warning is no longer suppressed or emitted, with the existing test suite still passing.
Written by the indexing model from the issue text.
Description
Clippy throws following warning:
warning: large size difference between variants
--> src\connection\parser\message.rs:10:1
|
10 | / pub enum Message {
11 | | MementoInitial(Option<GameState>),
| | --------------------------------- the largest variant contains at least 608 bytes
12 | | MementoLastMove(Option<u8>, Option<Move>),
13 | | MoveRequest,
14 | | Result(Option<GameResult>),
| | -------------------------- the second-largest variant contains at least 80 bytes
15 | | }
| |_^ the entire enum is at least 608 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.96.0/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum
|
11 - MementoInitial(Option<GameState>),
11 + MementoInitial(Box<Option<GameState>>),
|
The warning is currently surpressed by #[allow(clippy::large_enum_variant)].
The issue is in src/connection/parser/message.rs from line 9 onwards.
- Dominant language
- Rust
- Stars
- 3
- Forks
- 1
- Avg merge
- 8h 33m
- Merged PRs (30d)
- 18
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 software-challenge/player_rust
-
Message: Message should not wrap everything in OptionsPossibly taken @NichtNil5 claimed this 12 days ago. Open
software-challenge/player_rust#38 · 1 assignee ·
Maintainers usually reply within 1 day
-
GameState: Getter should not return references to types that implement CopyPossibly taken @NichtNil5 claimed this 12 days ago. Open
software-challenge/player_rust#37 · 1 assignee ·
Maintainers usually reply within 1 day
-
Publishing workflow doesn't work because of branch protecitonPossibly taken @SturmEnte claimed this 12 days ago. Open
software-challenge/player_rust#35 · 1 assignee ·
Maintainers usually reply within 1 day
-
Error handling missingPossibly taken @NichtNil5 claimed this 17 days ago. Open
software-challenge/player_rust#24 · 1 comment · 2 assignees ·
Maintainers usually reply within 1 day
-
Documentation for developers and pupilsPossibly taken @NichtNil5 claimed this 12 days ago. Open
software-challenge/player_rust#8 · 7 comments · 2 assignees ·
Maintainers usually reply within 1 day
All issues in software-challenge/player_rust
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
521xueweihan/HelloGitHub#4023 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nautechsystems/nautilus_trader#5365 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
IntersectMBO/developer-experience#347 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
registrystack/registry-stack#2168 ·
Maintainers usually reply within 1 day
-
bug crate: 3d help wanted triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kornia/kornia-rs#1203 · 1 comment ·
Maintainers usually reply within 1 day