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

feat: make {from,to}_{b,l}e_bytes const #329

Merged
merged 7 commits into from Oct 13, 2023
Merged

Conversation

DaniPopes
Copy link
Contributor

Motivation

Const impl + some perf gains

Solution

Hand roll use of iterators, for loops and slice::reverse

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

Comment on lines +195 to +196
/// Converts a big-endian byte array of size exactly
/// [`Self::BYTES`] to [`Uint`].
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason for reordering methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

consistency

Copy link
Collaborator

Choose a reason for hiding this comment

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

ya, just makes the functional review harder

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (641cd1d) 80.55% compared to head (6bd6a54) 80.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
+ Coverage   80.55%   80.78%   +0.22%     
==========================================
  Files          54       54              
  Lines        6039     6111      +72     
==========================================
+ Hits         4865     4937      +72     
  Misses       1174     1174              
Files Coverage Δ
src/bytes.rs 96.12% <94.91%> (-0.76%) ⬇️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

Very nice

@prestwich prestwich merged commit 0fdcd4d into recmo:main Oct 13, 2023
20 checks passed
@DaniPopes DaniPopes deleted the const-bytes branch October 13, 2023 18:01
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