-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature idea - enumeration variant matching #53
Comments
Thank you for your proposal! Introducing pattern matching with descriptive error message is challenging as far as my knowledge goes. It may be worth enabling users to delegate checking by passing an anonymous function; for example |
Interesting. Sorry, I haven't thought about the error messages. Very good point. |
In the generic approach in my comment, error message for
The actual value (= It may have slight difficulties in macros to |
Alright, sounds like a good extension to me. 👍 |
Hey 👋🏾
I really like the fluid syntax of this library. While working with it, a few assertions would be great to have. Some of them are for ergonomics when working with enumeration variants. Like simple matching. So I could imagine for example something like:
With the "default" API you can write these simply with
assert!(matches!(...))
. But then we have the syntax of theassertor
it'sassert_that!
mixed with the other. Which does not read and feel great. So I though it might be easy enough to add this? 🙈In any case: thanks for this library. Like it so far!
The text was updated successfully, but these errors were encountered: