Skip to content

fix: make SparseArray and MutSparseArray methods public - #25

Open
iAmMichaelConnor wants to merge 1 commit into
masterfrom
mike/02-fix-public-api
Open

iAmMichaelConnor wants to merge 1 commit into
masterfrom
mike/02-fix-public-api

Conversation

@iAmMichaelConnor

@iAmMichaelConnor iAmMichaelConnor commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #24; please review and merge in order.

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 (Noir 1.0.0; bb gates 3,265). 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.
@TomAFrench
TomAFrench force-pushed the mike/02-fix-public-api branch from 1bf48b3 to 511e270 Compare November 3, 2026 03:53
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