the borrow checker
This commit is contained in:
parent
5f507ceada
commit
2e839fb307
1 changed files with 8 additions and 0 deletions
|
|
@ -20,5 +20,13 @@ impl List{
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self { head: Link::Empty }
|
Self { head: Link::Empty }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn push(&mut self, elem: i32) {
|
||||||
|
let new_node = Node {
|
||||||
|
elem: elem,
|
||||||
|
next: self.head
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue