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

Convert NodePtr to a newtype rather than alias #333

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

Rigidity
Copy link
Contributor

@Rigidity Rigidity commented Aug 9, 2023

This encapsulates NodePtr as a separate type (with all necessary traits derived) rather than a type alias to i32. This prevents typos or mistakes where you would use NodePtr somewhere that expects a normal i32 or vice versa. It also allows separate implementations of traits, for example encoding and decoding a NodePtr with a CLVM allocator would be a no-op, whereas i32 is encoded as an atom.

@Rigidity Rigidity requested a review from arvidn August 9, 2023 21:05
@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 5814062287

  • 30 of 30 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 93.884%

Totals Coverage Status
Change from base Build 5513827559: -0.002%
Covered Lines: 5219
Relevant Lines: 5559

💛 - Coveralls

@Rigidity Rigidity merged commit 41b9bd1 into main Aug 10, 2023
25 checks passed
@Rigidity Rigidity deleted the ptr-newtype branch August 10, 2023 13:43
MarvinQuevedo pushed a commit to MarvinQuevedo/clvm_rs that referenced this pull request Aug 26, 2023
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

2 participants