another mem replace
This commit is contained in:
parent
06ce6d7cc3
commit
4319534b6b
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ impl List {
|
||||||
|
|
||||||
pub fn pop(&mut self) -> Option<i32> {
|
pub fn pop(&mut self) -> Option<i32> {
|
||||||
let result;
|
let result;
|
||||||
match &self.head {
|
match std::mem::replace(&mut self.head, Link::Empty) {
|
||||||
Link::Empty => {
|
Link::Empty => {
|
||||||
result = None;
|
result = None;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue