instead. Obviously the above doesn't compile, but is there a shorter way to say "all I care about is whether enum foo is variant Bar"? Or could there be? I think it'd be cool to have the equality operator work with a pattern on one side, but I have no idea what it would mean if you tried to do that with the other comparison operators, so doing it with == doesn't make much sense. Has this kind of thing been discussed before in the context of rust?
The problem is that having things like .. or _ in the pattern don't work with ==. Yes PartialEq and Eq are derived, but foo == Foo::Bar(..) is a syntax error because of the .., same with foo == Foo::Bar(_). You can put a value in there and it will work, but if you don't care about the wrapped value and only care about "is this Foo the Bar variant", the patterns don't work with ==
#[must_use = "if you intended to assert that this has a value, consider `.unwrap()` instead"]
#[inline]
pub const fn is_some(&self) -> bool {
matches!(*self, Some(_))
}