Added test for single_match_else in macro

This commit is contained in:
pmk21 2020-03-31 15:49:49 +05:30
parent ba6a3280f5
commit 793403a2a8

View file

@ -18,4 +18,18 @@ fn unwrap_addr() -> Option<&'static ExprNode> {
}
}
fn main() {}
macro_rules! unwrap_addr {
($expression:expr) => {
match $expression {
ExprNode::ExprAddrOf => Some(&NODE),
_ => {
let x = 5;
None
},
}
};
}
fn main() {
unwrap_addr!(ExprNode::Unicorns);
}