mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-07 06:44:57 +08:00
No need to match expand pop, just return it (#1154)
This commit is contained in:
@ -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()
|
||||
}
|
||||
|
||||
/* 访问栈顶元素 */
|
||||
|
Reference in New Issue
Block a user