From eb8d4b7b208e2feabe095117440caae08b1d3565 Mon Sep 17 00:00:00 2001 From: "Peng Hailin," Date: Fri, 12 May 2023 19:09:48 +0800 Subject: [PATCH] Update Ch15 --- projects/cons_list_demo/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/cons_list_demo/src/main.rs b/projects/cons_list_demo/src/main.rs index 7094fee..dc4a269 100644 --- a/projects/cons_list_demo/src/main.rs +++ b/projects/cons_list_demo/src/main.rs @@ -11,10 +11,12 @@ use std::rc::Rc; fn main() { let value = Rc::new(RefCell::new(5)); - let a = Rc::new(Cons( + let a = Rc::new( + Cons( Rc::clone(&value), Rc::new(Nil) - )); + ) + ); let b = Cons( Rc::new(RefCell::new(3)),