Tidy up#107
Merged
Merged
Conversation
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().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding in some newtypes to make the typing clearer.
Also fixed some broken tests and run formatter.