-
Notifications
You must be signed in to change notification settings - Fork 80
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
deer
: implement Deserialize
for tuples
#2418
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2418 +/- ##
==========================================
+ Coverage 56.32% 57.00% +0.68%
==========================================
Files 338 342 +4
Lines 26248 26085 -163
Branches 384 421 +37
==========================================
+ Hits 14784 14871 +87
+ Misses 11463 11209 -254
- Partials 1 5 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 33 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Realized i forgot to submit this review weeks ago :)
} | ||
|
||
#[rustfmt::skip] | ||
macro_rules! all_the_tuples { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuples all the way down
Schema::new("array") | ||
.with("prefixItems", [$(doc.add::<$elem>()),*]) | ||
.with("items", false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see this conform to the newest draft 👍
* feat: glue helper trait `TupleExt` * feat: take code from #1875 and fix * test: array impl * fix: miri
🌟 What is the purpose of this PR?
Implements
Deserialize
for tuples of up to 16 items (likeaxum
), originally taken from #1875, because there is no variadic support for tuples just yet (or even ever? D:) this is quite macro-heavy code.Stats:
serde
: up to 16 elementsproptest
: up to 9 elementsbuiltin
: up to 12 elements forPartialEq
,Eq
,PartialOrd
,Debug
,Default
,Hash
, other built-in traits are infinite.deer
: up to 16 elementsaxum
: up to 16 elementsTo facilitate proper error handling a temporary trait
TupleExt
has been added, once #2377 has been resolved a more long-term solution will be implemented.🔗 Related links
deer
type implementation #1700deer
implementDeserialize
for built-in types (Part 2) #1875🚀 Has this modified a publishable library?
This PR: