derive-new
derive-new copied to clipboard
Constructor with different name than "new"?
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")]
We could even optionally remove the "new_" prefix entirely for enums.