rustlings icon indicating copy to clipboard operation
rustlings copied to clipboard

iterators4 "dont use return"

Open tryoxiss opened this issue 1 year ago • 2 comments

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.

tryoxiss avatar Feb 07 '24 22:02 tryoxiss

Good point, I'll clean this up!

shadows-withal avatar Mar 15 '24 14:03 shadows-withal

Pushed a fix in https://github.com/rust-lang/rustlings/commit/d8ecf4bc2d34a10149999a7974d5ba71625fab90, let me know if that works out better in your perception.

shadows-withal avatar Mar 15 '24 14:03 shadows-withal