Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Fix large enum variant

Open Beginner friendly
#22 0 comments 0 reactions 1 assignee View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from software-challenge/player_rust

All issues in software-challenge/player_rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.