the borrow checker

This commit is contained in:
Sander Hautvast 2022-01-26 18:55:33 +01:00
parent 5f507ceada
commit 2e839fb307

View file

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