-
Notifications
You must be signed in to change notification settings - Fork 24
Add a new std::mem::copied function. #78
Copy link
Copy link
Closed
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Metadata
Metadata
Assignees
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Type
Fields
Give feedbackNo fields configured for issues without a type.
Proposal
Add a new
std::mem::copiedfunction.Problem statement, Motivation, use-cases
Right now if you want to pass a function pointer to a combinator, you need to define a new closure. This is a very small paper cut, but it comes up quite frequently. Having a named function reduces the line noise and makes the code easier to read.
Solution sketches
The new function will make the code simpler:
Links and related work
This mirrors
core::mem::dropandcore::mem::take.rust-lang/rust#95534, rust-lang/rust#98262, rust-lang/rust#100006
What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals in its weekly meeting. You should receive feedback within a week or two.