summaryrefslogtreecommitdiff
path: root/info.toml
diff options
context:
space:
mode:
authorliv <mokou@fastmail.com>2022-08-16 09:37:39 +0200
committerGitHub <noreply@github.com>2022-08-16 09:37:39 +0200
commit8a4ed70762c012f3e6819a3249397950410f5403 (patch)
treee9f88e04e7f5226e507fee5fa501fbcc0af95c4c /info.toml
parent25ab52b8e722df8b18b1e46651b56783d62f76af (diff)
parent1c3b003c7c5fa89642f64e49adc4b145e6392a44 (diff)
Merge pull request #1069 from exdx/rc-exercise
feat: add rc1.rs exercise
Diffstat (limited to 'info.toml')
-rw-r--r--info.toml14
1 files changed, 14 insertions, 0 deletions
diff --git a/info.toml b/info.toml
index 2787535..9aa11e8 100644
--- a/info.toml
+++ b/info.toml
@@ -933,6 +933,20 @@ 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<T> 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 :(
+"""
+
+[[exercises]]
name = "cow1"
path = "exercises/standard_library_types/cow1.rs"
mode = "compile"