diff --git a/src/main.rs b/src/main.rs index 6a3890c..0ffdd24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,5 +20,13 @@ impl List{ pub fn new() -> Self { Self { head: Link::Empty } } + + pub fn push(&mut self, elem: i32) { + let new_node = Node { + elem: elem, + next: self.head + }; + } + }