Skip to content

Pass plain lists and indexed items, letting RustQ borrow them - #10

Open
dannote wants to merge 2 commits into
masterfrom
plain-lists-and-indexed-items
Open

dannote wants to merge 2 commits into
masterfrom
plain-lists-and-indexed-items

Conversation

@dannote

@dannote dannote commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

With RustQ 1.0.0-rc.21 the generator's helpers drop most explicit borrows:

  • ref(array([...])) arguments are plain lists, borrowed as slices.
  • fields.get(index).unwrap() and ref(index(fields, index)) are index(fields, index), borrowed because the items are not Copy.
  • ref(index(fields, index).kind) is index(fields, index).kind.
  • ref(values) into make_struct_from_arrays is values.

The generated Rust is unchanged apart from make_struct_from_arrays(env, keys, &values) (was &&values) and &fields[index] (was fields.get(index).unwrap()). Borrows into Rustler's own map_from_term_arrays and deref of a raw function pointer stay, since RustQ has no types for them.

Also removes an unused @runtime attribute from the native test.

Summary by CodeRabbit

  • Compatibility
    • Generated native decoders now work with RustQ 1.0.0-rc.21 and later compatible releases.
    • The documented RustQ development and test dependency requirement has been updated to ~> 1.0.0-rc.21.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e61c475f-73ae-483e-9d50-05ee93e8758d
Commits

Reviewing files that changed from the base of the PR and between 9cb1744 and 9c509fe.

Files ignored due to path filters: 1
  • mix.lock is excluded by !**/*.lock
Files selected for processing: 9
  • CHANGELOG.md
  • README.md
  • codegen/kiwi_codec/rustler_generator/full/helpers.ex
  • codegen/kiwi_codec/rustler_generator/skip/helpers.ex
  • codegen/kiwi_codec/rustler_generator/sparse/helpers.ex
  • guides/native-decoders.md
  • integration/generator_consumer/mix.exs
  • mix.exs
  • test/kiwi_codec/rustler_generator_test.exs
Files with no reviewable changes: 1
  • test/kiwi_codec/rustler_generator_test.exs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The RustQ requirement changes from rc.19 to rc.21. Generated full, skip, and sparse decoder helpers now pass arrays and indexed fields without the prior reference wrappers.

Changes: RustQ helper compatibility

Layer / File(s) Summary
RustQ version requirement
CHANGELOG.md, README.md, guides/native-decoders.md, integration/generator_consumer/mix.exs, mix.exs
Dependency constraints and documentation now specify RustQ ~> 1.0.0-rc.21. The optional local-path override remains unchanged.
Generated helper expressions
codegen/kiwi_codec/rustler_generator/*/helpers.ex, test/kiwi_codec/rustler_generator_test.exs
Full, skip, and sparse helpers pass arrays and indexed fields directly. The test module no longer declares the @runtime source attribute.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Possibly related PRs

Merge Risk: Minimal · up to 9c509

No actionable regression introduced by this PR remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main generator change: passing plain lists and indexed items so RustQ can borrow them.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5 files. (3 skipped: 3 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5 files. (3 skipped: 3 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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