diff --git a/exercises/standard_library_types/box1.rs b/exercises/standard_library_types/box1.rs index f312f3d6..d950dddc 100644 --- a/exercises/standard_library_types/box1.rs +++ b/exercises/standard_library_types/box1.rs @@ -16,11 +16,9 @@ // // Execute `rustlings hint box1` for hints :) -// I AM NOT DONE - #[derive(PartialEq, Debug)] pub enum List { - Cons(i32, List), + Cons(i32, Box), Nil, } @@ -33,11 +31,14 @@ fn main() { } pub fn create_empty_list() -> List { - unimplemented!() + List::Nil } pub fn create_non_empty_list() -> List { - unimplemented!() + List::Cons( + 1, + Box::new(List::Cons(2, Box::new(List::Cons(3, Box::new(List::Nil))))), + ) } #[cfg(test)]