Skip to content

fix: make SparseArray and MutSparseArray methods public - #25

Merged
iAmMichaelConnor merged 1 commit into
masterfrom
mike/02-fix-public-api
Nov 11, 2026
Merged

iAmMichaelConnor merged 1 commit into
masterfrom
mike/02-fix-public-api

Conversation

@iAmMichaelConnor

@iAmMichaelConnor iAmMichaelConnor commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Stack

PR Change Builds on
➡ this PR 1 of 5: #25 fix: make SparseArray and MutSparseArray methods public master
2 of 5: #26 fix: read boundary sentinel values from the sorted keys #25
3 of 5: #27 fix: constrain MutSparseArray lookup hints #26
4 of 5: #28 fix: support creating sparse arrays from empty inputs #27
5 of 5: #29 chore: fix README usage example #28

Each PR is based on the one above it. Please review and merge in order from the top.

What

The README documents SparseArray::create/get and MutSparseArray::create/get/set as
the library's API, but they are pub(crate) or private, so a dependent crate cannot construct
or read either array: the library is unusable as a dependency. Make these five methods pub.
Nothing else changes visibility: MutSparseArray::length, which the README does not document,
and the struct internals stay private.

This is a fix rather than a feature: it restores the documented API (in v0.1.x these methods
had no visibility modifier, at a time when Noir treated impl methods as public).

Testing

Visibility cannot be tested inside the crate. A separate consumer crate calling all five
methods fails to compile on master ("create is private", "get is private", "set is private")
and compiles here. A consumer calling MutSparseArray::length still fails with "length is
private". nargo test: 17/17 passed. nargo fmt --check is clean.

Base automatically changed from mike/01-v6-noir-1.0.0 to master November 3, 2026 03:53
The README documents create/get/set as the library API, but the methods
are private or pub(crate), so no dependent crate can construct or read
either array.
@iAmMichaelConnor
iAmMichaelConnor merged commit 2020316 into master Nov 11, 2026
9 checks passed
@iAmMichaelConnor
iAmMichaelConnor deleted the mike/02-fix-public-api branch November 11, 2026 13:16
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