Skip to content

Clarify docs for when binary_search has many matches. #54700

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
Oct 8, 2018

Conversation

frewsxcv
Copy link
Member

Fixes #51817.

@rust-highfive
Copy link
Contributor

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 30, 2018
@frewsxcv
Copy link
Member Author

r? @rust-lang/docs

/// element could be inserted while maintaining sorted order.
/// If the value is found then `Ok` is returned, containing the index of
/// the matching element. If there are multiple matches, then any one of the
/// matches could be returned. If the value is not found then `Err` is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add link to variant.

/// the index for the matched element; if no match is found then
/// `Err` is returned, containing the index where a matching
/// element could be inserted while maintaining sorted order.
/// If the value is found then `Ok` is returned, containing the index of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add link to variant.

/// element could be inserted while maintaining sorted order.
/// If the value is found then `Ok` is returned, containing the index of
/// the matching element. If there are multiple matches, then any one of the
/// matches could be returned. If the value is not found then `Err` is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add link to variant.

/// index for the matched element; if no match is found then `Err`
/// is returned, containing the index where a matching element could
/// be inserted while maintaining sorted order.
/// If the value is found then `Ok` is returned, containing the index of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add link to variant.

/// be inserted while maintaining sorted order.
/// If the value is found then `Ok` is returned, containing the index of
/// the matching element. If there are multiple matches, then any one of the
/// matches could be returned. If the value is not found then `Err` is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add link to variant.

@frewsxcv frewsxcv force-pushed the frewsxcv-binary-search branch from 17b1d28 to 9466f42 Compare October 6, 2018 15:12
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:53:00] ................................................................................................i... 2200/4556
[00:53:04] .................................................................................................... 2300/4556
[00:53:08] .................................................................................................... 2400/4556
[00:53:12] .................................................................................................... 2500/4556
[00:53:16] ........iiiiiiiii................................................................................... 2600/4556
[00:53:22] .................................................................................................... 2800/4556
[00:53:26] .................................................................................................... 2900/4556
[00:53:28] ............................i....................................................................... 3000/4556
[00:53:31] ........................................................................................i.i..ii..... 3100/4556
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:06:15] 
[01:06:15] running 107 tests
[01:06:18] i..ii...iii....i...i.........i..iii...........i.....i....ii...i.i.ii..............i...ii..ii.i....ii 100/107
[01:06:19] test result: ok. 77 passed; 0 failed; 30 ignored; 0 measured; 0 filtered out
[01:06:19] 
[01:06:19]  finished in 3.354
[01:06:19] travis_fold:end:test_codegen
---
[01:31:10] travis_fold:end:stage0-linkchecker

[01:31:10] travis_time:end:stage0-linkchecker:start=1538844452915796099,finish=1538844455193037581,duration=2277241482

[01:32:39] std/vec/struct.Vec.html:1255: broken link - std/vec/result/enum.Result.html
[01:32:39] std/vec/struct.Vec.html:1257: broken link - std/vec/result/enum.Result.html
[01:32:39] std/vec/struct.Vec.html:1278: broken link - std/vec/result/enum.Result.html
[01:32:39] std/vec/struct.Vec.html:1280: broken link - std/vec/result/enum.Result.html
[01:32:39] std/vec/struct.Vec.html:1303: broken link - std/vec/result/enum.Result.html
[01:32:39] std/vec/struct.Vec.html:1305: broken link - std/vec/result/enum.Result.html
[01:33:31] thread 'main' panicked at 'found some broken links', tools/linkchecker/main.rs:49:9
[01:33:31] 
[01:33:31] 
[01:33:31] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker" "/checkout/obj/build/x86_64-unknown-linux-gnu/doc"
[01:33:31] expected success, got: exit code: 101
[01:33:31] expected success, got: exit code: 101
[01:33:31] 
[01:33:31] 
[01:33:31] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:33:31] Build completed unsuccessfully in 0:45:13
[01:33:31] make: *** [check] Error 1
[01:33:31] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0778553f
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 6, 2018

@GuillaumeGomez Any suggestions how I should add links when these docs get used on slice and Vec pages?

@frewsxcv frewsxcv force-pushed the frewsxcv-binary-search branch 2 times, most recently from 1b12490 to ceedaa6 Compare October 7, 2018 12:42
@frewsxcv frewsxcv force-pushed the frewsxcv-binary-search branch from ceedaa6 to b5c64e2 Compare October 7, 2018 12:46
@frewsxcv
Copy link
Member Author

frewsxcv commented Oct 7, 2018

@GuillaumeGomez CI is passing. r?

@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 7, 2018

📌 Commit b5c64e2 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2018
@bors
Copy link
Collaborator

bors commented Oct 8, 2018

⌛ Testing commit b5c64e2 with merge ef5c00d...

bors added a commit that referenced this pull request Oct 8, 2018
Clarify docs for when binary_search has many matches.

Fixes #51817.
@bors
Copy link
Collaborator

bors commented Oct 8, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing ef5c00d to master...

@bors bors merged commit b5c64e2 into rust-lang:master Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants