Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iterators4 "dont use return" #1851

Open
tryoxiss opened this issue Feb 7, 2024 · 2 comments
Open

iterators4 "dont use return" #1851

tryoxiss opened this issue Feb 7, 2024 · 2 comments

Comments

@tryoxiss
Copy link

tryoxiss commented Feb 7, 2024

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.

@shadows-withal
Copy link
Member

Good point, I'll clean this up!

@shadows-withal
Copy link
Member

Pushed a fix in d8ecf4b, let me know if that works out better in your perception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants