-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Remove the return value of String::splice #44038
Copy link
Copy link
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.
As discussed in #32310, it is never necessary to look at the return value of String::splice. Applying the splice eagerly is always simpler and at least as efficient.
With a return value:
splice, receiveSplicestruct.Splicestruct.Without a return value;
splicewhich eagerly does the replace and returns ().