Stabilize VecDeque::truncate_front#151379
Conversation
|
@BurntSushi I know process is required before this patch can be approved but is a pull request the correct way to do it or is there another way? |
|
@rustbot reroll |
|
@rfcbot merge libs-api |
|
Team member @Amanieu 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. |
|
Some alternatives to consider:
I would be okay with any of the 3 designs. |
|
After further consideration, I think I'd be fine shipping this as-is. I think the "retain" family isn't as good a fit; that family generally involves a predicate. I do find the idea of steering people towards something range-based rather than On that basis, I think it makes sense to stabilize this. And in addition, I'd personally love to see an API for "keep only this specified range", rather than adding any kind of @rfcbot reviewed |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@joshtriplett The idea of retaining only an inner range is an interesting idea. Do you have any example uses in mind? The best I could imagine is collecting metrics, sorting by a field, then discarding some of the top and bottom as unrepresentative. But the sort requires going through |
|
In a bevy crate I have rather complex deques that contain data for undo-redo actions. The collection also contains an Though my case is even more complex because I also provide draining iterators of the past and future at this method, which I do by draining all of the deque, collect into a boxed slice if the iterator gets to the segment I want to keep, and on |
Tracking issue: #140667
Closes: #140667
@rustbot label -T-libs +T-libs-api +needs-fcp +S-waiting-on-fcp
r? t-libs-api