Skip to content
This repository was archived by the owner on Jan 21, 2023. It is now read-only.

Conversation

@L-as
Copy link

@L-as L-as commented Jun 9, 2018

example:

	enum E {
		A(u32),
		B,
	}

	let e = E::A(2);
	assert_eq!(unwrap_match!(e, E::A(i) => i), 2);

I realise that you might not accept this, since it is not a part of the RFC, however I believe that this is a very useful feature.

example:
```rust
	enum E {
		A(u32),
		B,
	}

	let e = E::A(2);
	assert_eq!(unwrap_match!(e, E::A(i) => i), 2);
```
@L-as
Copy link
Author

L-as commented Jun 9, 2018

I am not sure whether the formatting is correct, but I've used 4 spaces for indentation and I've made sure to not have any extraneous whitespace.

@SimonSapin
Copy link
Owner

I’m not very interested in expanding this crate. Consider publishing your own? And I’m not sure which RFC you mean, rust-lang/rfcs#163 was closed four years ago.

@L-as
Copy link
Author

L-as commented Jun 10, 2018

Sure, I'll close this pull request and make my own crate.

@L-as L-as closed this Jun 10, 2018
@SOF3
Copy link

SOF3 commented Nov 20, 2019

@laaas did you eventually release such a crate?

@L-as
Copy link
Author

L-as commented Nov 20, 2019

@SOF3 https://docs.rs/matches2/1.1.0/matches2/

If something isn't to your liking, feel free to make a PR (or I can transfer ownership). Looking back at it, the thing I regret the most is the name probably.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants