Skip to content

Buildable trait should be removed #7

@lilyball

Description

@lilyball

I love the idea of this crate for writing builder patterns, but I want the use of this crate to be transparent to end-users. The comments on the Buildable trait say it exists to handle the edge case of the type already having a builder() method. I don't really understand why this is a problem; if the type already has one, why is it using makeit? Builder isn't something that can be applied to an existing type either, it's something used on a type as it's being defined. Instead I would simply prefer an optional #[builder(method = "builder")] attribute that lets me rename the builder method. This same attribute could also be used to rename the builder type (and wrapper module) as well.

I suppose today I can implement an inherent builder() method that invokes the trait method, but that's a bit awkward and shouldn't be necessary just to let clients of my type call its builder.

Metadata

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