Skip to content

Fix examples for returning closures.#26191

Merged
bors merged 1 commit into
rust-lang:masterfrom
jimblandy:master
Jun 11, 2015
Merged

Fix examples for returning closures.#26191
bors merged 1 commit into
rust-lang:masterfrom
jimblandy:master

Conversation

@jimblandy

Copy link
Copy Markdown
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
Copy Markdown
Contributor

@bors: r+ rollup

@bors

bors commented Jun 10, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 7d298d1 has been approved by steveklabnik

@steveklabnik

Copy link
Copy Markdown
Contributor

Thanks so much jim!

@jimblandy

Copy link
Copy Markdown
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