Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add std::mem::take as suggested in #61129 #61130
This PR implements #61129 by adding
The added function is equivalent to:
This particular pattern is fairly common, especially when implementing
return Async::Ready(std::mem::replace(self.result, Vec::new()));
EDIT: Changed name from
@cramertj I sort of intentionally wanted it to be relatively short and concise. I see the point about wanting the name to indicate what gets left in its place though. The signature would likely tell you very quickly, but we may want it reflected in the name as well. Maybe
Team member @sfackler has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
I’d prefer this be named
This is closer to a