another mem replace

This commit is contained in:
Sander Hautvast 2022-01-26 19:10:02 +01:00
parent 06ce6d7cc3
commit 4319534b6b

View file

@ -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;
} }