2 ms·
if let is usually good enough to check variants. Matches! should be useful to implement methods like is_some() or is_ok(). Also for assertions, but then again
by bonzini 7y ago
if let is usually good enough to check variants. Matches! should be useful to implement methods like is_some() or is_ok().
Also for assertions, but then again there is a crate that provides assert_matches!, which is more useful for this than matches! itself.