rust-lang / rustlings

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

suggestion to be able to reset one excercise. #2030

Open DaQue opened 2 months ago

DaQue commented 2 months ago

When I am working on an exercise when I make lots of changes trying stuff that sometimes didn't work. I would suggest a way to reset the current exercise source code back to the original unmodified example added to the h:hint / l:list / q:quit ? options. Maybe /r:reset? .

mo8it commented 2 months ago

I thought about that but also didn't want people to reset a file by mistake. This is especially a problem on Windows where you don't need to press ENTER after entering something in the prompt. Entering l then r is more explicit for me and can't easily happen by mistake.

But we could also add r:reset with a confirmation. What do you think?

matthewjnield commented 1 month ago

I was going to request the same feature, but after learning about the ability to reset exercises from the list menu after pressing l mentioned above, that approach has been sufficient for me.

I still think adding an r command that resets the current exercise to the main menu would be a good idea, and that a confirmation step should be required, such as pressing r again, or typing the word "reset".