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 {
|
||||
elem: i32,
|
||||
next: List,
|
||||
pub struct List {
|
||||
head: Link
|
||||
}
|
||||
|
||||
pub enum List {
|
||||
enum Link{
|
||||
Empty,
|
||||
More(Box<Node>),
|
||||
}
|
||||
}
|
||||
|
||||
struct Node {
|
||||
elem: i32,
|
||||
next: Link,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue