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 {
elem: i32,
next: List,
pub struct List {
head: Link
}
pub enum List {
enum Link{
Empty,
More(Box<Node>),
}
struct Node {
elem: i32,
next: Link,
}