Skip to content

refactor: split command.rs into command/ module#265

Merged
kacy merged 1 commit intomainfrom
feat/split-command-module
Feb 24, 2026
Merged

refactor: split command.rs into command/ module#265
kacy merged 1 commit intomainfrom
feat/split-command-module

Conversation

@kacy
Copy link
Owner

@kacy kacy commented Feb 24, 2026

summary

splits the 7,888-line crates/ember-protocol/src/command.rs into a command/ module with focused submodules:

file lines purpose
mod.rs 731 Command enum, SetExpire, ScoreBound, ZAddFlags type definitions
attributes.rs 619 command_name(), is_write(), acl_categories(), primary_key() methods
parse.rs 2,974 from_frame() dispatcher, all 134 parse_* functions, extraction helpers
tests.rs 3,585 all 400+ command parsing tests

pure reorganization — no logic changes.

what was tested

  • cargo test -p ember-protocol — 406 tests pass
  • cargo test --workspace — 1,350 tests pass
  • cargo clippy -p ember-protocol -- -D warnings — clean
  • cargo check --workspace — all crates compile

design considerations

chose a flat 4-file split over a deeper hierarchy (e.g. parse/strings.rs, parse/lists.rs). the flat structure keeps imports simple and avoids creating many tiny files. parse.rs at ~3k lines is still the largest file, but it's cohesive — all parsing logic in one place. if it grows further, the parser functions could be split by data type in a follow-up.

break the 7,888-line command.rs into focused submodules:

- mod.rs (731 lines) — Command enum, SetExpire, ScoreBound, ZAddFlags
- attributes.rs (619 lines) — command_name(), is_write(), acl_categories(), primary_key()
- parse.rs (2,974 lines) — from_frame() dispatcher, all parse_* functions, helpers
- tests.rs (3,585 lines) — all 400+ command parsing tests

pure reorganization — no logic changes, all tests pass.
@kacy kacy merged commit 627943e into main Feb 24, 2026
6 of 7 checks passed
@kacy kacy deleted the feat/split-command-module branch February 24, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant