rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

Check not only code output but also code itself

Open Mart-Bogdan opened this issue 2 years ago • 1 comments
trafficstars

Examaple if1 requires you to use IF instead of standard function, but it is not enforced

image

I also noticed similar cases in variables, where I was able to add mut instead of creating new binding that is shadowing old binding. Etc.

Mart-Bogdan avatar Sep 15 '23 17:09 Mart-Bogdan

It also don't assert output

image

Mart-Bogdan avatar Sep 15 '23 17:09 Mart-Bogdan

Closing in favor of https://github.com/rust-lang/rustlings/issues/293

I don't think that we should try to enforce solving the exercises more than we currently do.

  1. Parsing and checking code can quickly get very complicated. We leave this task to the compiler and the linter Clippy.
  2. If the user "cheats" or just takes a shortcut, no harm is done since this is not an exam :P
  3. It would be much better to provide a solution so that the user sees how the exercise was actually meant to be solved.

mo8it avatar Mar 30 '24 15:03 mo8it