Skip to content

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 force-pushed the move_newtypes_to_module branch from 27e739c to e787d77 Compare December 4, 2022 13:13
@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.

2 participants