rustlings
rustlings copied to clipboard
iterators4 "dont use return"
In rustlings iterators4
, part of the instructions says "dont use return". I feel like this is poorly worded, as rust functions need to return someting, and in fact, the entire point of the function is to return the factorial.
If its about early returns (returning before the end of the function) then I would say something like "dont return early". Since end of function returns can be explict (e.g., return thing;
) or implicit (thing
) with no diffrence to functionality, and likewise you can return anywhere without using the return keyword.
Just felt really weird and a little unclear on what the intention is and felt like it should be cleaned up a bit.
Good point, I'll clean this up!
Pushed a fix in https://github.com/rust-lang/rustlings/commit/d8ecf4bc2d34a10149999a7974d5ba71625fab90, let me know if that works out better in your perception.