Pops the element at the top of the stack if it is a register; returns `None` otherwise.
(&mut self)
| 439 | /// Pops the element at the top of the stack if it is a register; |
| 440 | /// returns `None` otherwise. |
| 441 | pub fn pop_reg(&mut self) -> Option<TypedReg> { |
| 442 | match self.peek() { |
| 443 | Some(v) => v.is_reg().then(|| self.pop().unwrap().unwrap_reg()), |
| 444 | _ => None, |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | /// Pops the given register if it is at the top of the stack; |
| 449 | /// returns `None` otherwise. |
no test coverage detected