-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
binary_search() takes a reference of the element instead of using Borrow instances. This is causing problems:
&Stringdoesn't make any sense. I should be able to just use&swheresis aStringto search in aVec<String>.- Current API sometimes causes redundant allocations (e.g. when I have a
&strat hand, I need to allocate aString) - API is inconsistent in that some other containers use
Borrowfor this purpose. E.g.HashMap. As a guideline, I think lookup functions of containers should just useBorrowalways.
Metadata
Metadata
Assignees
Labels
E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.