Skip to content

Tidy up#107

Merged
CarolineMorton merged 6 commits into
mainfrom
tidy-up
Apr 24, 2026
Merged

Tidy up#107
CarolineMorton merged 6 commits into
mainfrom
tidy-up

Conversation

@CarolineMorton
Copy link
Copy Markdown
Collaborator

@CarolineMorton CarolineMorton commented Apr 24, 2026

Adding in some newtypes to make the typing clearer.

Also fixed some broken tests and run formatter.

maturin build produces a wheel but does not install it into the active
venv, so tests were running against whatever was last manually installed.
Use maturin develop instead, which builds and installs into the active
venv. Requires sourcing bindings/python/.venv/bin/activate before just ci.
Newtype wraps String with compile-time distinction only — no content
validation at this layer. serde(transparent) keeps the wire format as
a plain JSON string. Canonical conversions via From<String>, From<&str>,
and From<Code> for String.
CodeListError::ContributorNotFound now carries a Contributor (not
String), so remove_contributor takes Contributor by value and moves
it into the error on the not-found path — no as_str().to_string()
dance.

Python binding's add_contributor, remove_contributor, and the
Provenance::new call site in PyCodeList::new wrap incoming strings
with Contributor::from at the FFI boundary. Python-facing signatures
remain String; the binding exposes contributors as native strings
via as_str().
@CarolineMorton CarolineMorton merged commit 763386c into main Apr 24, 2026
7 checks passed
@CarolineMorton CarolineMorton deleted the tidy-up branch April 24, 2026 14:08
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