Skip to content

Instantly share code, notes, and snippets.

@Hydrotoast
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hydrotoast/35905252323bab78d25a to your computer and use it in GitHub Desktop.
Save Hydrotoast/35905252323bab78d25a to your computer and use it in GitHub Desktop.
// linked_list.rs:11:25: 11:26 error: expected one of `;`, `}` but found `:`
// linked_list.rs:11 ListIterator<T> { data: &self }
enum List<T> {
Cons(T, ~List<T>),
Nil
}
struct ListIterator<T> { data: &List<T> }
impl<T> List<T> {
fn iter(~self) -> ListIterator<T> {
ListIterator<T> { data: &self }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment