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

Change internal representation of commands into an `enum`

Open
#538 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start by locating the existing Command struct and all code that reads its code field. Update command representation and its users to match the proposed Command enum and CommandDetails structure. Done means commands are represented by enum variants with their associated details, without storing the command character in Command.

Written by the indexing model from the issue text.

Description

Rather than storing inside Command the command's character as code, represent each command as an enum.

So the existing:

pub struct Command {
    pub code: char,                         // Command code
    pub addr1: Option<Address>,             // Start address

will become

// Sed commands derived from single-character command codes
pub enum Command {
    Append,  // a
    Branch,  // b
    Change,  // c
    // …
}

pub struct CommandDetails {
    pub command: Command,                   // Command to perform
    pub addr1: Option<Address>,             // Start address
Dominant language
Rust
Stars
110
Forks
36
Avg merge
1d 23h
Merged PRs (30d)
30

Getting set up

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 uutils/sed

All issues in uutils/sed

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.