mem replace
This commit is contained in:
parent
2e839fb307
commit
41db07a8a3
1 changed files with 1 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ impl List{
|
|||
pub fn push(&mut self, elem: i32) {
|
||||
let new_node = Node {
|
||||
elem: elem,
|
||||
next: self.head
|
||||
next: std::mem::replace(&mut self.head, Link::Empty)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue