Skip to content

Allow automatically derived Show for enums to be just the field name #18669

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

Closed
mitsuhiko opened this issue Nov 5, 2014 · 1 comment
Closed

Comments

@mitsuhiko
Copy link
Contributor

When working with enums for error reporting it would be super useful if the default implementation of Show for enums could be customized so that you can skip the contained data. For instance if you have a MyError(SomeOtherError) it is interesting to just get MyError instead of MyError(SomeOtherError { foo: 42 }) or whatever is contained in there.

@steveklabnik
Copy link
Member

I believe the Display/Debug split takes care of this now, as Display no longer has a default implementation for exactly this reason.

lnicola pushed a commit to lnicola/rust that referenced this issue Dec 16, 2024
internal: Only parse the object file once in proc-macro-srv
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