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

Underline the correct alternative variant in case of error. #98

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

GilShoshan94
Copy link
Contributor

Fix #97.

Small PR to underline the correct alternative variant when they are not written in order.

Before:

image

image

After:

image

image

@GilShoshan94 GilShoshan94 changed the title fix #97 Underline the correct alternative variant in case of error. Jan 15, 2023
@illicitonion
Copy link
Owner

This change looks good to me, thanks!

Could I bother you to add a test for this? If you add a simple example .rs file to https://github.com/illicitonion/num_enum/tree/main/num_enum/tests/try_build/compile_fail (like https://github.com/illicitonion/num_enum/blob/main/num_enum/tests/try_build/compile_fail/alternative_exprs.rs) and run the tests, it should output the required .stderr file which you can move into the same directory.

@GilShoshan94
Copy link
Contributor Author

Done, I added 2 tests for that.

Copy link
Owner

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again!

@illicitonion illicitonion merged commit 483e933 into illicitonion:main Jan 16, 2023
@GilShoshan94
Copy link
Contributor Author

GilShoshan94 commented Jan 22, 2023

@illicitonion,
Can you please release this update on crates.io as the version 0.5.9 ?

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

Successfully merging this pull request may close these issues.

Wrong bad variant underline in error case.
2 participants