Skip to content

chore: Change JSON::compute_keyhash_and_sort_json_entries to have pub(crate) visibility#94

Merged
aakoshh merged 1 commit intomainfrom
af/10718-private-extension
Dec 2, 2025
Merged

chore: Change JSON::compute_keyhash_and_sort_json_entries to have pub(crate) visibility#94
aakoshh merged 1 commit intomainfrom
af/10718-private-extension

Conversation

@aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Dec 2, 2025

Description

Problem*

This should allow noir-lang/noir#10736 to be merged

Summary*

Changes the visibility of JSON::compute_keyhash_and_sort_json_entries from private to pub(crate), to allow it to be called from JSON::parse_json with the changes noir-lang/noir#10736 introduces.

Additional Context

The compute_keyhash_and_sort_json_entries is defined in the keymap module, while the JSON structure and the parse_json method are in the json module. The keymap and json modules are siblings, so they shouldn't see each others' privates. There was a loophole for impl blocks, where they acted as if we were in the same type, regardless of the surrounding module, but this is not correct (or at least not how Rust works; it makes it harder for modules to isolate their functionality from each other).

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@aakoshh aakoshh requested a review from a team December 2, 2025 14:52
@aakoshh aakoshh merged commit f747ee9 into main Dec 2, 2025
8 checks passed
@aakoshh aakoshh deleted the af/10718-private-extension branch December 2, 2025 15:04
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