-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
slice::contains with borrowed data #62367
Copy link
Copy link
Open
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-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.
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
HashSet::containshas the following type to allow e.g. searching in aHashSet<String>with an&str:However,
slice::containsdoes not useBorrow, so to search in an&[String]one has to actually allocate aString:Is there a fundamental reason for this, or is this just an omission?