-
Notifications
You must be signed in to change notification settings - Fork 28
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
Always implement Default for Vec #63
Conversation
soa-derive-internal/src/input.rs
Outdated
@@ -116,6 +116,7 @@ impl Input { | |||
match meta.path.get_ident() { | |||
Some(ident) => { | |||
assert!(ident != "Copy", "can not derive Copy for SoA vectors"); | |||
assert!(ident != "Default", "Default is already derived for SoA vectors"); |
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.
This makes this PR a breaking change.
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.
Could you also add default for the slice and slice_mut types? And then, we can ignore Default
in soa_derive
without error!
This will silently ignore Default derive requests as well.
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.
Thanks!
I propose to always implement
Default
forVec
.This makes it behave more like
std::vec::Vec<T>
, which implementsDefault
regardless ofT
.