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 new adapter PickFirst, picking between multiple deserialization options #291

Merged
merged 4 commits into from
Mar 30, 2021

Conversation

jonasbb
Copy link
Owner

@jonasbb jonasbb commented Mar 27, 2021

@pashadia I found some time to implement the DeserializeOptions you proposed in #276.

I'm not quite happy with the name yet. I am thinking maybe something along those line:

  • Choose
  • Choices
  • PickFirst

This was originally proposed in #276 under the name
DeserializeOptions.
The adapter takes 2-4 types and tries each in order. The first option
which deserializes is returned.

The type is still missing documentation.

…tion options

This was originally proposed in #276 under the name
`DeserializeOptions`.
The adapter takes 2-4 types and tries each in order. The first option
which deserializes is returned.

The type is still missing documentation.
@jonasbb jonasbb changed the title Implement new adapter PicKFirst, picking between multiple deserialization options Implement new adapter PickFirst, picking between multiple deserialization options Mar 27, 2021
@codecov
Copy link

codecov bot commented Mar 27, 2021

Codecov Report

Merging #291 (0016d27) into master (459617a) will increase coverage by 0.25%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #291      +/-   ##
==========================================
+ Coverage   78.04%   78.29%   +0.25%     
==========================================
  Files          40       41       +1     
  Lines        2337     2387      +50     
==========================================
+ Hits         1824     1869      +45     
- Misses        513      518       +5     
Impacted Files Coverage Δ
src/lib.rs 75.00% <ø> (ø)
tests/serde_as/lib.rs 100.00% <ø> (ø)
src/de/impls.rs 70.05% <78.94%> (+1.06%) ⬆️
src/ser/impls.rs 97.14% <85.71%> (-1.27%) ⬇️
tests/serde_as/pickfirst.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 459617a...0016d27. Read the comment docs.

@jonasbb jonasbb marked this pull request as ready for review March 28, 2021 11:25
@jonasbb
Copy link
Owner Author

jonasbb commented Mar 30, 2021

I'm just gonna merge this with the current name. I rather have this published.

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 30, 2021

Build succeeded:

@bors bors bot merged commit 13646d3 into master Mar 30, 2021
@bors bors bot deleted the pickfirst branch March 30, 2021 21:06
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.

1 participant