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

Constructor with different name than "new"? #46

Open
Boscop opened this issue Oct 3, 2019 · 1 comment
Open

Constructor with different name than "new"? #46

Boscop opened this issue Oct 3, 2019 · 1 comment

Comments

@Boscop
Copy link

Boscop commented Oct 3, 2019

Is it possible to name the ctor differently than "new"?
I have several use cases where I use the derived new only internally in my real ctor that should be used by client code. The fact that derive-new names the ctor new means I can't use that name for my handwritten ctor, but I'd like to.
Could you add the feature to name it differently?
E.g. #[derive(new = "new_internal")]

@arnodb
Copy link

arnodb commented Jan 28, 2020

We could even optionally remove the "new_" prefix entirely for enums.

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

2 participants