Skip to content

refactor: extract_strings and extract_bytes_vec helpers in ember-protocol#100

Merged
kacy merged 1 commit intomainfrom
refactor/protocol-helpers
Feb 12, 2026
Merged

refactor: extract_strings and extract_bytes_vec helpers in ember-protocol#100
kacy merged 1 commit intomainfrom
refactor/protocol-helpers

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Feb 12, 2026

summary

  • added extract_strings(frames) and extract_bytes_vec(frames) helpers in command.rs
  • replaced 9 occurrences of .iter().map(extract_string).collect::<Result<Vec<_>, _>>()? and 2 occurrences of the extract_bytes variant

affected parsers: parse_del, parse_exists, parse_mget, parse_unlink, parse_zrem, parse_hdel, parse_hmget, parse_sadd, parse_srem, parse_lpush, parse_rpush

what was tested

  • cargo clippy -p ember-protocol -- -D warnings — clean
  • cargo test -p ember-protocol — all 297 tests pass (296 unit + 1 doc)

the .iter().map(extract_string).collect::<Result<Vec<_>, _>>()?
chain appeared 9 times and the extract_bytes variant 2 times.
added extract_strings() and extract_bytes_vec() — each call site
drops from 3 lines to a single call.
@kacy kacy merged commit 5ba826e into main Feb 12, 2026
7 checks passed
@kacy kacy deleted the refactor/protocol-helpers branch February 12, 2026 15:52
kacy added a commit that referenced this pull request Feb 19, 2026
the .iter().map(extract_string).collect::<Result<Vec<_>, _>>()?
chain appeared 9 times and the extract_bytes variant 2 times.
added extract_strings() and extract_bytes_vec() — each call site
drops from 3 lines to a single call.
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