Skip to content

Fix examples for returning closures. #26191

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

Merged
merged 1 commit into from
Jun 11, 2015
Merged

Conversation

jimblandy
Copy link
Contributor

In the discussion of returning closures, it seems like the example code got simplified, but only the later copies got fixed. The final working code has factory returning |x| x + num, but the earlier code has |x| vec.push(x).

The first form seemed to have more distracting characteristics, and the code wasn't right anyway, so I changed them to all use the second form, and updated the error messages.

r? @steveklabnik

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 10, 2015

📌 Commit 7d298d1 has been approved by steveklabnik

@steveklabnik
Copy link
Member

Thanks so much jim!

@jimblandy
Copy link
Contributor Author

Sure thing!

Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 11, 2015
In the discussion of returning closures, it seems like the example code got simplified, but only the later copies got fixed. The final working code has `factory` returning `|x| x + num`, but the earlier code has `|x| vec.push(x)`.

The first form seemed to have more distracting characteristics, and the code wasn't right anyway, so I changed them to all use the second form, and updated the error messages.

r? @steveklabnik
bors added a commit that referenced this pull request Jun 11, 2015
@bors bors merged commit 7d298d1 into rust-lang:master Jun 11, 2015
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

Successfully merging this pull request may close these issues.

3 participants