Improve match statements

This commit is contained in:
ayushmishra2005 2021-05-14 08:57:33 +05:30
parent 4698b366c4
commit 7d83f98ff3

View file

@ -31,10 +31,7 @@ fn option_as_ref_deref() {
}
fn match_like_matches() {
let _y = match Some(5) {
Some(0) => true,
_ => false,
};
let _y = matches!(Some(5), Some(0));
}
fn match_same_arms() {