mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-12 13:49:19 +00:00
Switch arc and rc exercises order
`rc` should totally be introduced _before_ `arc`
This commit is contained in:
parent
2398f378b0
commit
b369e36123
28
info.toml
28
info.toml
@ -915,6 +915,20 @@ Although the current list is one of integers (i32), feel free to change the defi
|
|||||||
and try other types!
|
and try other types!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
[[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
|
||||||
|
|
||||||
|
* Unfortunately Pluto is no longer considered a planet :(
|
||||||
|
"""
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "arc1"
|
name = "arc1"
|
||||||
path = "exercises/standard_library_types/arc1.rs"
|
path = "exercises/standard_library_types/arc1.rs"
|
||||||
@ -932,20 +946,6 @@ 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
|
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
|
|
||||||
|
|
||||||
* Unfortunately Pluto is no longer considered a planet :(
|
|
||||||
"""
|
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "cow1"
|
name = "cow1"
|
||||||
path = "exercises/standard_library_types/cow1.rs"
|
path = "exercises/standard_library_types/cow1.rs"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user