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

Implement Encode for tuples with up-to 16 elements. #583

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

gz
Copy link
Contributor

@gz gz commented Sep 27, 2022

This makes it match the implementation of Decode which already supports up to 16 fields.

This makes it match the implementation for Decode which is
already supports up to 16 fields.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Base: 55.66% // Head: 54.21% // Decreases project coverage by -1.45% ⚠️

Coverage data is based on head (9a02f99) compared to base (3849e37).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk     #583      +/-   ##
==========================================
- Coverage   55.66%   54.21%   -1.46%     
==========================================
  Files          50       50              
  Lines        4313     4429     +116     
==========================================
  Hits         2401     2401              
- Misses       1912     2028     +116     
Impacted Files Coverage Δ
src/enc/impl_tuples.rs 30.95% <0.00%> (-69.05%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@VictorKoenders
Copy link
Contributor

I forget why this isn't a macro as well, but I see no reason to block this PR on that

Copy link
Contributor

@VictorKoenders VictorKoenders left a comment

Choose a reason for hiding this comment

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

Thanks!

@VictorKoenders VictorKoenders merged commit 92f4d00 into bincode-org:trunk Sep 28, 2022
@VictorKoenders
Copy link
Contributor

For your vmware PR; the next release candidate milestone is tracked here: https://github.com/bincode-org/bincode/milestone/6

@gz
Copy link
Contributor Author

gz commented Sep 28, 2022

I forget why this isn't a macro as well, but I see no reason to block this PR on that

I tried to improve that, but struggled with generating code that uses .0, .1, .2 etc. when trying to access the tuple members A, B, C etc. for calling encode. So eventually I gave up.

For future reference: Maybe the right way is to unpack the tuple with something like let $tuple_name($($element),*) = self;

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