Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

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

Merged
VictorKoenders merged 1 commit intobincode-org:trunkfrom
gz:more-tuples
Sep 28, 2022
Merged

Implement Encode for tuples with up-to 16 elements.#583
VictorKoenders merged 1 commit intobincode-org:trunkfrom
gz:more-tuples

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants