Skip to content

Support concrete default for generic/impl Trait argument. #168

Open
@zakstucke

Description

@zakstucke

Great library!

It would be really powerful to provide concrete defaults for generic parameters, the below example fails to compile:

#[builder]
fn foo(#[builder(default = std::iter::empty())] arg: impl IntoIterator<Item = String>) {
    drop(arg);
}
213 |     #[builder]
    |     ---------- expected this type parameter
214 |     fn foo(#[builder(default = std::iter::empty())] arg: impl IntoIterator<Item = String>) {
    |                                ^^^^^^^^^^^^^^^^^^ expected type parameter `I1`, found `Empty<_>`

A note for the community from the maintainers

Please vote on this issue by adding a 👍 reaction to help the maintainers with prioritizing it. You may add a comment describing your real use case related to this issue for us to better understand the problem domain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions