From 44e336238679f2d6a360c165a029792d76845489 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Fri, 19 Apr 2024 13:56:27 -0400 Subject: [PATCH] Finish Box --- exercises/19_smart_pointers/box1.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/19_smart_pointers/box1.rs b/exercises/19_smart_pointers/box1.rs index 513e7da..2da338b 100644 --- a/exercises/19_smart_pointers/box1.rs +++ b/exercises/19_smart_pointers/box1.rs @@ -18,11 +18,9 @@ // // Execute `rustlings hint box1` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE - #[derive(PartialEq, Debug)] pub enum List { - Cons(i32, List), + Cons(i32, Box), Nil, } @@ -35,11 +33,11 @@ fn main() { } pub fn create_empty_list() -> List { - todo!() + List::Nil } pub fn create_non_empty_list() -> List { - todo!() + List::Cons(3, Box::new(List::Nil)) } #[cfg(test)]