feat: completed solutions
This commit is contained in:
@@ -12,18 +12,18 @@
|
||||
// TODO: Use a `Box` in the enum definition to make the code compile.
|
||||
#[derive(PartialEq, Debug)]
|
||||
enum List {
|
||||
Cons(i32, List),
|
||||
Cons(i32, Box<List>),
|
||||
Nil,
|
||||
}
|
||||
|
||||
// TODO: Create an empty cons list.
|
||||
fn create_empty_list() -> List {
|
||||
todo!()
|
||||
List::Nil
|
||||
}
|
||||
|
||||
// TODO: Create a non-empty cons list.
|
||||
fn create_non_empty_list() -> List {
|
||||
todo!()
|
||||
List::Cons(64, Box::new(List::Nil))
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
Reference in New Issue
Block a user