-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add VarZeroVecFormat support to VarTuple and make_var #5808
Conversation
it's internal: "user convenience" is irrelevant and this is safer
f978e56
to
d64044e
Compare
assert!(!fields.is_empty(), "Must have at least one unsized field"); | ||
Self { fields } | ||
|
||
let format_param = format_param.unwrap_or_else(|| quote!(zerovec::vecs::Index16)); |
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.
Thought: make it a required parameter?
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.
I'd rather not: I want the user-facing things (VarZeroVec, make_varule, TupleNVarULE) to default to Index16. Formats are a power user tool IMO.
fn test_tripleule_validate() { | ||
test_tripleule_validate_inner::<Index8>(); | ||
test_tripleule_validate_inner::<Index16>(); | ||
test_tripleule_validate_inner::<Index32>(); |
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.
Suggestion: add a test that serializing and deserializing between different formats is usually an error (unless we're unlucky and the bits are valid in both formats)
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.
I don't see the point of a test like that. If it succeeds, it's a valid representation. We already have scattered tests that ensure that invalid types don't parse with carefully chosen non-parsing data, I don't see any benefit to writing one around swapping formats specifically.
d64044e
to
d7c8d0f
Compare
ff2cc52
to
1f96ed4
Compare
Part of holistic work in #5523
Part of #2312 (Somehow never filed a separate issue for this, but I mentioned it in a commetn)