list on the heap - compiling
This commit is contained in:
parent
bfdea56399
commit
5ffe48f2d3
1 changed files with 10 additions and 5 deletions
15
src/main.rs
15
src/main.rs
|
|
@ -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,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue