refactor: split command.rs into command/ module#265
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
splits the 7,888-line
crates/ember-protocol/src/command.rsinto acommand/module with focused submodules:mod.rsCommandenum,SetExpire,ScoreBound,ZAddFlagstype definitionsattributes.rscommand_name(),is_write(),acl_categories(),primary_key()methodsparse.rsfrom_frame()dispatcher, all 134parse_*functions, extraction helperstests.rspure reorganization — no logic changes.
what was tested
cargo test -p ember-protocol— 406 tests passcargo test --workspace— 1,350 tests passcargo clippy -p ember-protocol -- -D warnings— cleancargo check --workspace— all crates compiledesign 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.rsat ~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.