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

refactor: Make ParameterIndex generic #138

Merged
merged 1 commit into from
Mar 17, 2024
Merged

Conversation

jetuk
Copy link
Member

@jetuk jetuk commented Mar 11, 2024

This removes IndexParameterIndex (awful name!) and MultiValueParameterIndex in favour of a generic ParameterIndex<T>. Where T is the return type of the associated Parameter<T>. This ensures there is stronger type constraints to prevent using the wrong index in the wrong vec of parameters.

@jetuk jetuk requested a review from Batch21 March 11, 2024 14:30
@jetuk jetuk mentioned this pull request Mar 11, 2024
3 tasks
This removes `IndexParameterIndex` (awful name!) and
`MultiValueParameterIndex` in favour of a generic `ParameterIndex<T>.`
Where `T` is the return type of the associated `Parameter<T>`. This
ensures there is stronger type constraints to prevent using the
wrong index in the wrong vec of parameters.
@jetuk jetuk force-pushed the generic-parameter-index branch from 7187104 to 65125f3 Compare March 12, 2024 16:39
Copy link
Contributor

@Batch21 Batch21 left a comment

Choose a reason for hiding this comment

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

Bit annoying that those traits have to manually derived but this is definitely much cleaner overall

@jetuk jetuk merged commit cf71944 into main Mar 17, 2024
18 checks passed
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.

2 participants