rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
52.69k stars 10.02k forks source link

Rework Rc exercise #2083

Open TheGP opened 1 month ago

TheGP commented 1 month ago

What kind of exercise is there for Rc? There is no exercise, just some copy-paste stuff. The same for Arc. And by the way, I didn't read anything about Arc / Cow in the book while doing smart pointers. For lifetimes it was too simple as well.

TheGP commented 4 weeks ago

I found the Arc, it is later in the book https://rust-book.cs.brown.edu/ch16-03-shared-state.html#shared-state-concurrency

mo8it commented 4 weeks ago

I don't find this feedback constructive. I will rename the issue to focus on one point.

TheGP commented 3 weeks ago

As there are no exercises there can't be any constructive feedback either. I'm suggesting adding some exercises for Rc & Arc.

leroivi commented 2 weeks ago

I agree that the Rc exercice is not really worth. As the surrounded code treats other values exactly the same way, the pattern is way too noticeable and the learner (me) can copy/paste without understanding anything. I think the exercice shouldn't expose the usage example on others value. Maybe we can come up with an exercice designed around a device that needs to be unique (like Audio system).

@TheGP about LifeTime : the Readme indicates that there is a lifetimekata project that propose exercises that go deeper. I think it's good enough and allow this project to put the effort on other parts.