mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-24 10:16:28 +08:00
No need to match expand pop, just return it (#1154)
This commit is contained in:
parent
82a7dc9dcc
commit
556af1624c
1 changed files with 1 additions and 4 deletions
|
@ -36,10 +36,7 @@ impl<T> ArrayStack<T> {
|
|||
|
||||
/* 出栈 */
|
||||
fn pop(&mut self) -> Option<T> {
|
||||
match self.stack.pop() {
|
||||
Some(num) => Some(num),
|
||||
None => None,
|
||||
}
|
||||
self.stack.pop()
|
||||
}
|
||||
|
||||
/* 访问栈顶元素 */
|
||||
|
|
Loading…
Reference in a new issue