list on the heap - compiling

This commit is contained in:
Sander Hautvast 2022-01-26 18:52:22 +01:00
parent bfdea56399
commit 5ffe48f2d3

View file

@ -2,12 +2,17 @@ fn main() {
} }
struct Node { pub struct List {
elem: i32, head: Link
next: List,
} }
pub enum List { enum Link{
Empty, Empty,
More(Box<Node>), More(Box<Node>),
} }
struct Node {
elem: i32,
next: Link,
}