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

Util to load test vector #201

Merged
merged 1 commit into from
May 13, 2024
Merged

Util to load test vector #201

merged 1 commit into from
May 13, 2024

Conversation

diehuxx
Copy link
Contributor

@diehuxx diehuxx commented May 12, 2024

Closes #196

Comment on lines +261 to +262
let vectors: TestVectorFile<VectorInput, VectorOutput> =
TestVectorFile::load_from_path(path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the typing of the generics is also possible like this:

Suggested change
let vectors: TestVectorFile<VectorInput, VectorOutput> =
TestVectorFile::load_from_path(path);
let vectors = TestVectorFile::<VectorInput, VectorOutput>::load_from_path(path);

both are semantically equivalent, but the type definition for the generics live in different places syntactically

I tend to prefer the proposed way but it's potato, potahto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL -- I like the latter option too, thanks for showing me!

Copy link
Contributor

@KendallWeihe KendallWeihe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is eggsellent, love how we are able to to standardize the TestVector and TestVectorFile type structs

I do wonder if it would be wise to disambiguate crates/ versus something like internal-crates/ but I don't have any great ideas right now

@KendallWeihe KendallWeihe merged commit 268cc8c into main May 13, 2024
6 checks passed
@KendallWeihe KendallWeihe deleted the test-vector-util branch May 13, 2024 14:20
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.

Create shared/reusable code for loading test vectors
2 participants