rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

suggestion to be able to reset one excercise.

Open DaQue opened this issue 1 year ago • 2 comments

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? .

DaQue avatar Jul 07 '24 13:07 DaQue

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?

mo8it avatar Jul 07 '24 13:07 mo8it

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".

matthewjnield avatar Aug 04 '24 06:08 matthewjnield

Done in https://github.com/rust-lang/rustlings/commit/0c79f2ea3e1fd2db54ebe8fba8ed17369a15b365

mo8it avatar Sep 26 '24 16:09 mo8it