-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Explain closures much better in the tutorial #13621
Labels
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Comments
Closed
part of #11755 |
I think this should be much better than before. Perhaps some more complex examples should be included. I tried to get their stack closure example to |
Merged
bors
added a commit
that referenced
this issue
May 4, 2014
Improve tutorial discussion of closures, e.g. with respect to type inference and variable capture. Fix #13621 ---- original description follows I'd like this pulled to master if possible but if not I'd appreciate comments on what I need to change. I found the closures difficult to understand as they were so I tried to explain it so I would've had an easier time understanding it. I think it's better at least, somewhat. I don't know that everyone liked the `-> ()` I included but I thought explicit is best to aid understanding. I thought it was much harder to understand than it should have been. [EDIT] - Clicked too early. This doesn't `make check` without errors on my Xubuntu on Virtualbox machine. Not sure why. I don't think I changed anything problematic. I'll try `make check` on master tomorrow. Opened #13621 regarding this.
arcnmx
pushed a commit
to arcnmx/rust
that referenced
this issue
Dec 17, 2022
…as-schievink fix: make make_body respect comments in extract_function Possible fix for rust-lang#13621 ### Points to help in review: - Earlier we were only considering statements in a block expr and hence comments were being ignored, now we handle tokens hence making it aware of comments and then preserving them using `hacky_block_expr_with_comments` Seems like I am not able to attach output video, github is glitching for it :(
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Basically, I didn't think the tutorial helped much at all to explain closures so I tried to understand it and make changes so that it is clearer. Guys on IRC helped answer my questions so I
thinkhope what I changed is pretty accurate.I'll probably try to do more but I wanted to put this up so people could see. I think it's much better. They're all in this commit.
mdinger@b580964
Let me be clear, from reading the tutorial earlier, it wasn't obvious
b: |int|
had anything to do with a function. I thought it meant anint
was gonna be assigned tob
. All the vertical bars did was make it special.The text was updated successfully, but these errors were encountered: