rust-workshop-linkedlist/src/main.rs
2022-01-26 18:53:36 +01:00

24 lines
232 B
Rust

fn main() {
}
pub struct List {
head: Link
}
enum Link{
Empty,
More(Box<Node>),
}
struct Node {
elem: i32,
next: Link,
}
impl List{
pub fn new() -> Self {
Self { head: Link::Empty }
}
}