-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remove_current_as_list to LinkedList's CursorMut #71878
Conversation
The `remove_current` method only returns the inner `T` and deallocates the list node. This is unnecessary for move operations, where the element is going to be linked back into this (or even a different) `LinkedList`. The `remove_current_as_list` method avoids this by returning the unlinked list node as a new single-element `LinkedList` structure .
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @hanna-kruppe (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
r? @Amanieu |
@bors r+ rollup |
📌 Commit c5cdf7f has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#71587 (Report cannot move errors in promoted MIR) - rust-lang#71711 (Updates to some ignored tests) - rust-lang#71845 (Add const examples) - rust-lang#71878 (Add remove_current_as_list to LinkedList's CursorMut) - rust-lang#71881 (Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode) - rust-lang#71883 (add a missing "at" in a comment) - rust-lang#71891 (¬∃x. ¬y => ∀x. y) - rust-lang#71892 (Update btree_map::VacantEntry::insert docs to actually call insert) - rust-lang#71902 (Suggest to add missing feature when using gated const features) - rust-lang#71904 (fix typo in function name) Failed merges: r? @ghost
The
remove_current
method only returns the innerT
and deallocates the list node. This is unnecessary for move operations, where the element is going to be linked back into this (or even a different)LinkedList
. Theremove_current_as_list
method avoids this by returning the unlinked list node as a new single-elementLinkedList
structure.(per #58533 (comment))