Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move newtypes into module #421

Merged
merged 1 commit into from Dec 4, 2022
Merged

Conversation

molpopgen
Copy link
Member

Moves the newtype code from src/lib.rs to src/newtypes.rs.
This move forces the rest of the API to only rely on the public API of a newtype.

The current design allows access to the .0 field of each newtype struct,
which is something of an anti-pattern.
This reliance is also a road block to ideas regarding future API safety.

@molpopgen molpopgen marked this pull request as ready for review December 4, 2022 13:44
@molpopgen molpopgen merged commit 4c2c949 into main Dec 4, 2022
@molpopgen molpopgen deleted the move_newtypes_to_module branch December 4, 2022 13:44
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.

None yet

1 participant