Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(nll)]
- #![allow(dead_code)]
- struct List {
- next: Option<Box<List>>,
- }
- impl List {
- fn walk_the_list(&self) {
- let mut current = self;
- while let Some(inner) = ¤t.next {
- current = inner;
- }
- }
- fn consume_the_list(self) {
- self.walk_the_list();
- }
- }
- fn main() {}
Add Comment
Please, Sign In to add comment