list on the heap

This commit is contained in:
Sander Hautvast 2022-01-26 18:50:42 +01:00
parent 137686f79a
commit bfdea56399

View file

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