Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @kennytm (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. |
There was a problem hiding this comment.
Could this use the cursors API (currently unstable, but we can use it)? It looks like that should make this a bit cleaner.
There was a problem hiding this comment.
That seems reasonable. I'll push a commit with that in a bit.
There was a problem hiding this comment.
I have pushed up the changes
|
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 |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
Looking much better, left a few more comments though.
There was a problem hiding this comment.
Can we pull out len - at - 1 to e.g. "offset_from_end" or something like that?
|
I've made the requested changes |
Mark-Simulacrum
left a comment
There was a problem hiding this comment.
r=me with a tracking issue filed and added, as well as commits squashed; thanks! Sorry for the delay in review.
mlodato517
left a comment
There was a problem hiding this comment.
Threw out some potential re-wordings that you should feel free to ignore :-) And asked some questions so I can learn more about rust and writing code for others :-)
|
r=me with the comments resolved or not, just let me know if you want to fix any of them in this PR (if not I personally think this is fine to land without fixing them too) |
LinkedList::remove() removes the element at the specified index and returns it. Signed-off-by: Bijan Tabatabai <bijan311@yahoo.com>
|
I made some of the changes that mlodato517 suggested. This PR should be good to go now |
|
@bors r+ rollup Thanks! |
|
📌 Commit c797ce7 has been approved by |
Add LinkedList::remove() LinkedList::remove() removes the element at the specified index and returns it. I added this because I think having a remove function would be useful to have, and similar functions are in other containers, like Vec and HashMap. I'm not sure if adding a feature like this requires an RFC or not, so I'm sorry if this PR is premature.
Rollup of 5 pull requests Successful merges: - #68705 (Add LinkedList::remove()) - #68945 (Stabilize Once::is_completed) - #68978 (Make integer exponentiation methods unstably const) - #69266 (Fix race condition when allocating source files in SourceMap) - #69287 (Clean up E0317 explanation) Failed merges: r? @ghost
LinkedList::remove() removes the element at the specified index and returns it.
I added this because I think having a remove function would be useful to have, and similar functions are in other containers, like Vec and HashMap.
I'm not sure if adding a feature like this requires an RFC or not, so I'm sorry if this PR is premature.