Skip to content

Support arbitrary expression for #[builder(default = ...)] #330

Closed
@bew

Description

Hello!

I initially tried out the typed-builder crate but realized I needed runtime checks.
While migrating to derive_builder I noticed the syntax for default is less ergonomic.

With typed-builder I could do: #[builder(default = "foo".into())]
But with derive_builder I need to wrap the fn in a string: #[builder(default = r#""foo".into()"#)] which is much less ergonomic, and in an editor I can't do actions like 'go-to-definition'.

So here I am, asking to support that ;)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions