uwu
uwu

Reputation: 1738

Why does the LinkedList mutable iterator not have a `remove_next` method?

I want an O(1) delete of the node in the LinkedList::IterMut.Vec or other can't.

Upvotes: 2

Views: 191

Answers (1)

Daniel Fath
Daniel Fath

Reputation: 18109

The most likely reason as to why there isn't a remove_next method, is because Rust team is evaluating cursors as alternative approach:

#[inline]
#[unstable(feature = "collections",
           reason = "this is probably better handled by a cursor type -- we'll see")]

[Source]

Upvotes: 3

Related Questions