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

Extend Iterator::Find page with examples of Iterator::Position #1261

Closed
adamchalmers opened this issue Sep 18, 2019 · 0 comments · Fixed by rust-lang/rust#64979
Closed

Extend Iterator::Find page with examples of Iterator::Position #1261

adamchalmers opened this issue Sep 18, 2019 · 0 comments · Fixed by rust-lang/rust#64979

Comments

@adamchalmers
Copy link
Contributor

These two methods are so similar - both iterate an iterator until they find a value that matches a predicate. The only difference is one returns the element, and one returns its index.

Because of this, they should probably go on the same page. Currently the book doesn't document Iterator::position.

We could probably include a link to Iterator::rposition here too.

adamchalmers added a commit to adamchalmers/rust-by-example that referenced this issue Sep 18, 2019
adamchalmers added a commit to adamchalmers/rust-by-example that referenced this issue Sep 18, 2019
adamchalmers added a commit to adamchalmers/rust-by-example that referenced this issue Sep 18, 2019
marioidival added a commit that referenced this issue Sep 20, 2019
tmandry added a commit to tmandry/rust that referenced this issue Oct 2, 2019
Update books

## reference

3 commits in fa5dfb8..320d232
2019-09-16 20:42:56 +0200 to 2019-10-01 17:05:35 +0200
- Update async/await keywords to real keywords. (rust-lang/reference#687)
- Remove the warning that appears on every page. (rust-lang/reference#685)
- Eschew fp lit pattern (rust-lang/reference#683)

## book

9 commits in 871416b85c1a73717d65d6f4a9ea29e5aef3db0e..04806c80be0f54b1290287e3f85e84bdfc0b6ec7
2019-09-16 09:46:20 -0400 to 2019-10-01 20:20:22 -0400
- Fix tidy error. (rust-lang/book#2104)
- Fancy quotes
- Commit autogenerated cargo content
- Move all scripts into tools
- We can start lines with numbers without creating ordered lists
- ci: validate that all used references are defined (rust-lang/book#2032)
- Remove the check for unstable features
- Specify the rustc version we're using in a rust-toolchain file
- Fix broken link to Chapter 13-01 in Chapter 12-04 (rust-lang/book#2025)

## rust-by-example

9 commits in 67cfbf31df880728dcf7cb35b15b028ec92caf31..a6288e7407a6c4c19ea29de6d43f40c803883f21
2019-09-18 09:36:40 -0300 to 2019-10-01 10:09:14 -0300
- Add reference to lifetime in structs (rust-lang/rust-by-example#1274)
- Rectangle ambiguity (rust-lang/rust-by-example#1270)
- Make Parsing a String code editable (rust-lang/rust-by-example#1268)
- Fix match range pattern usage (rust-lang/rust-by-example#1269)
- Added type alias enum variant rfc (rust-lang/rust-by-example#1267)
- Chapter 9.2.5: impl FnOnce() works in 1.35 (rust-lang/rust-by-example#1266)
- Move chapters from folder "traits" to "trait" (rust-lang/rust-by-example#1263)
- Capturing changes (rust-lang/rust-by-example#1265)
- Fix rust-lang/rust-by-example#1261: document Iterator::position (rust-lang/rust-by-example#1262)

r? @ghost
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 a pull request may close this issue.

1 participant