diff --git a/codes/rust/chapter_stack_and_queue/array_stack.rs b/codes/rust/chapter_stack_and_queue/array_stack.rs index ca136c563..4aab6dc2b 100644 --- a/codes/rust/chapter_stack_and_queue/array_stack.rs +++ b/codes/rust/chapter_stack_and_queue/array_stack.rs @@ -36,10 +36,7 @@ impl ArrayStack { /* 出栈 */ fn pop(&mut self) -> Option { - match self.stack.pop() { - Some(num) => Some(num), - None => None, - } + self.stack.pop() } /* 访问栈顶元素 */