-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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:
&String
doesn't make any sense. I should be able to just use&s
wheres
is aString
to search in aVec<String>
.- Current API sometimes causes redundant allocations (e.g. when I have a
&str
at hand, I need to allocate aString
) - API is inconsistent in that some other containers use
Borrow
for this purpose. E.g.HashMap
. As a guideline, I think lookup functions of containers should just useBorrow
always.
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.