No need to match expand pop, just return it (#1154)

This commit is contained in:
rongyi 2024-03-27 01:29:43 +08:00 committed by GitHub
parent 82a7dc9dcc
commit 556af1624c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,10 +36,7 @@ impl<T> ArrayStack<T> {
/* 出栈 */ /* 出栈 */
fn pop(&mut self) -> Option<T> { fn pop(&mut self) -> Option<T> {
match self.stack.pop() { self.stack.pop()
Some(num) => Some(num),
None => None,
}
} }
/* 访问栈顶元素 */ /* 访问栈顶元素 */