Skip to content

✨ feat(mq-lang): add bytes operations#1744

Merged
harehare merged 1 commit into
mainfrom
feat/bytes-operations
May 15, 2026
Merged

✨ feat(mq-lang): add bytes operations#1744
harehare merged 1 commit into
mainfrom
feat/bytes-operations

Conversation

@harehare

Copy link
Copy Markdown
Owner

band, bor, bnot, pack/unpack, and bytes support for index/rindex/starts_with/ends_with/repeat

band, bor, bnot, pack/unpack, and bytes support for index/rindex/starts_with/ends_with/repeat

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds bitwise byte operations (band, bor, bnot), binary pack/unpack with 18 numeric formats, and extends existing index, rindex, starts_with, ends_with, and repeat builtins to operate on Bytes. Type signatures are registered in mq-check, and extensive rstest-based unit tests are added.

Changes:

  • New eval/builtin/bytes.rs module defining PackFormat plus pack_number/unpack_bytes helpers with full unit-test coverage.
  • New band/bor/bnot/pack/unpack builtins in builtin.rs, plus bytes branches added to index, rindex, starts_with, ends_with, and repeat; documentation strings updated.
  • Type-inference signatures for the new bytes operations registered in mq-check/src/builtin.rs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
crates/mq-lang/src/eval/builtin/bytes.rs New PackFormat enum and pack/unpack implementation with extensive tests.
crates/mq-lang/src/eval/builtin.rs Registers new builtins, extends existing ones for Bytes, updates docs, adds tests.
crates/mq-check/src/builtin.rs Registers type signatures for the new bytes-related builtins.

Comment thread crates/mq-lang/src/eval/builtin.rs
Comment thread crates/mq-lang/src/eval/builtin/bytes.rs
@codspeed-hq

codspeed-hq Bot commented May 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing feat/bytes-operations (6b784cf) with main (e6bfb35)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (28d90b3) during the generation of this report, so e6bfb35 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@harehare harehare merged commit 3a611d4 into main May 15, 2026
14 checks passed
@harehare harehare deleted the feat/bytes-operations branch May 15, 2026 13:51
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.

2 participants