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

Implement MutatorTuple for Vecs to allow Dynamic Mutator Choices #1893

Merged
merged 7 commits into from
Mar 4, 2024

Conversation

domenukk
Copy link
Member

@domenukk domenukk commented Feb 29, 2024

This PR adds a .into_vec function to MutatorsTuple and makes Vec<Box<dyn Mutator<I, S>>> implement MutatorsTuple - allowing us to use vecs instead of proper tuples in certain places.

@addisoncrump
Copy link
Collaborator

addisoncrump commented Feb 29, 2024

I really don't think this is the right answer. A Vec of mutators of a common type would be more appropriate, or using Tuneable. Introducing dyn makes future design decisions more restrictive and less user-friendly in the end.

@domenukk
Copy link
Member Author

As long as you don't use dyn you don't have any downsides, right?

@addisoncrump
Copy link
Collaborator

We've talked about this offline and I think we came to the conclusion that having dyn around but explicitly documenting it as not preferred (not deprecating the functionality) is a reasonable middle ground.

@domenukk domenukk merged commit b7efe8e into main Mar 4, 2024
25 of 26 checks passed
@domenukk domenukk deleted the mutator_tuple_vec branch March 4, 2024 21:48
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