Closed
Description
Instead of this:
if !stack.is_empty() {
match stack.pop().unwrap() {
...
}
} else {
...
}
do:
match stack.pop() {
Some(..) => ...
None => ...
}
Similarly, instead of this:
if stack.len() > 1 {
match (stack.pop().unwrap(), stack.pop().unwrap()) {
(Number(y), Number(x)) => ...
_ => ...
}
} else {
...
}
do:
match (stack.pop(), stack.pop()) {
(Some(Number(y)), Some(Number(x))) => ...
(Some(_), Some(_) => ...
_ => ...
}
There are multiple instances of these patterns in this file so make sure to clean up all of them