Use expect (#9883)

This commit is contained in:
zhangyaning 2018-11-09 19:54:23 +08:00 committed by Andronik Ordian
parent 17effd15ab
commit d42d816e7f
1 changed files with 1 additions and 5 deletions

View File

@ -66,11 +66,7 @@ impl<S : fmt::Display> Stack<S> for VecStack<S> {
}
fn pop_back(&mut self) -> S {
let val = self.stack.pop();
match val {
Some(x) => x,
None => panic!("Tried to pop from empty stack.")
}
self.stack.pop().expect("instruction validation prevents from popping too many items; qed")
}
fn pop_n(&mut self, no_of_elems: usize) -> &[S] {