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

Convert the builder type's generic params to a tuple #21

Closed
idanarye opened this issue Dec 12, 2019 · 0 comments
Closed

Convert the builder type's generic params to a tuple #21

idanarye opened this issue Dec 12, 2019 · 0 comments
Milestone

Comments

@idanarye
Copy link
Owner

(see discussion on #16)

Instead of:

pub struct FooBuilder<T1, T2, T3> {
    f1: T1,
    f2: T2,
    f3: T3,
    _TypedBuilder__phantomGenerics_: PhantomData<...>,
}

We should have:

pub struct FooBuilder<F> {
    fields: F,
    phantom: PhantomData<...>,
}

Where F would be (T1, T2, T3).

Using this style would allow transforming F with helper traits (and possibly helper macros) to write forward-compatible impl blocks for the builder type.

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

No branches or pull requests

1 participant