assert_matches icon indicating copy to clipboard operation
assert_matches copied to clipboard

Propose this to libstd in an RFC

Open faern opened this issue 8 years ago • 2 comments

Hi!

I found myself implementing a very similar macro a few times. I called it assert_pat, but it did virtually the same thing. Today I thought I should create an RFC proposing that my macro is added to the standard library. I find it very useful and ergonomic whenever you need to assert equality on something that does not implement Eq, but that can be matched by a destructure. For example, when using error-chain this is very needed, since the errors generated by that library does not implement Eq.

However. In my research I found this crate, which is awesome! But have you thought about suggesting it be included in the standard library?

faern avatar Feb 03 '17 23:02 faern

I hadn't considered submitting an RFC for inclusion into std. If you want to go forward with your RFC, you have my blessing to use this repo's code as a reference implementation.

murarth avatar Feb 04 '17 19:02 murarth

Partial implementations are in unstable libstd: https://github.com/rust-lang/rust/issues/82775.

8573 avatar Mar 16 '22 21:03 8573