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

Update trait impls and conversions for byte types #372

Merged
merged 6 commits into from
Jan 25, 2024
Merged

Conversation

Rigidity
Copy link
Contributor

@Rigidity Rigidity commented Jan 22, 2024

This PR adds missing conversions for Bytes, BytesImpl, and Program, and removes PartialEq implementations for other types to reduce complexity.

It also changes From to TryFrom in some cases where the conversion is fallible:

Note: This trait must not fail. The From trait is intended for perfect conversions. If the conversion can fail or is not perfect, use TryFrom.

https://doc.rust-lang.org/std/convert/trait.From.html

@Rigidity Rigidity requested a review from arvidn January 22, 2024 17:49
@Rigidity Rigidity marked this pull request as ready for review January 22, 2024 17:49
@Rigidity Rigidity changed the title Update trait impls and conversions for Bytes and BytesImpl Update trait impls and conversions for byte types Jan 23, 2024
Copy link

coveralls-official bot commented Jan 23, 2024

Pull Request Test Coverage Report for Build 7626926267

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 84.684%

Totals Coverage Status
Change from base Build 7547611610: -0.4%
Covered Lines: 11091
Relevant Lines: 13097

💛 - Coveralls

Copy link
Contributor

@arvidn arvidn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just a few comments and questions

chia-protocol/src/bytes.rs Show resolved Hide resolved
src/fast_forward.rs Outdated Show resolved Hide resolved
chia-protocol/src/program.rs Show resolved Hide resolved
@Rigidity Rigidity requested a review from arvidn January 23, 2024 21:17
@Rigidity Rigidity merged commit 3b2647d into main Jan 25, 2024
59 checks passed
@Rigidity Rigidity deleted the overhaul-byte-impls branch January 25, 2024 13:46
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