From ce86d252e529385704fe9111e305ac0ec48c2de4 Mon Sep 17 00:00:00 2001 From: Denton24646 Date: Sat, 16 Jul 2022 15:31:37 -0400 Subject: feat: add rc1.rs exercise --- info.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'info.toml') diff --git a/info.toml b/info.toml index 5b7b9b4..a72c014 100644 --- a/info.toml +++ b/info.toml @@ -929,6 +929,20 @@ is too much of a struggle, consider reading through all of Chapter 16 in the boo https://doc.rust-lang.org/stable/book/ch16-00-concurrency.html """ +[[exercises]] +name = "rc1" +path = "exercises/standard_library_types/rc1.rs" +mode = "compile" +hint = """ +This is a straightforward exercise to use the Rc type. Each Planet has +ownership of the Sun, and uses Rc::clone() to increment the reference count of the Sun. +After using drop() to move the Planets out of scope individually, the reference count goes down. +In the end the sun only has one reference again, to itself. See more at: +https://doc.rust-lang.org/book/ch15-04-rc.html + +* Unforunately Pluto is no longer considered a planet :( +""" + # THREADS [[exercises]] -- cgit v1.2.3