(&self)
| 42 | } |
| 43 | |
| 44 | fn print_node(&self) { |
| 45 | let mut curr = self.first.clone(); |
| 46 | while let Some(val) = curr { |
| 47 | print!("[{}]", &val.borrow().data); |
| 48 | curr = val.borrow().next.clone(); |
| 49 | } |
| 50 | print!("\n"); |
| 51 | } |
| 52 | |
| 53 | fn insert(&mut self, data: usize) { |
| 54 | let node = Rc::new(RefCell::new(Node::new(data))); |