From 472f99c8011b8de3f796c1ddc5d8f50164a34940 Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Sun, 27 Sep 2026 18:04:07 -0500 Subject: rustlings: complete 19 --- rustlings/exercises/19_smart_pointers/box1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rustlings/exercises/19_smart_pointers/box1.rs') diff --git a/rustlings/exercises/19_smart_pointers/box1.rs b/rustlings/exercises/19_smart_pointers/box1.rs index d70e1c3..ee379ca 100644 --- a/rustlings/exercises/19_smart_pointers/box1.rs +++ b/rustlings/exercises/19_smart_pointers/box1.rs @@ -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), 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(1, Box::new(List::Nil)) } fn main() { -- cgit v1.2.3