Amanieu / intrusive-rs

Intrusive collections for Rust
Apache License 2.0
400 stars 47 forks source link

Implement entry method for mutable cursor #10

Closed sergeyfedotov closed 7 years ago

sergeyfedotov commented 7 years ago

Are there any drawbacks with implementing entry method for CursorMut?

Like this: https://github.com/sergeyfedotov/intrusive-rs/blob/2b9d41c5b7fe87edbb1d91ad1eee6a32c0fa3d83/src/rbtree.rs#L795

Amanieu commented 7 years ago

This is actually unsound because Entry can return a CursorMut. This CursorMut could be used to unlink the element which the current CursorMut is pointing to.

sergeyfedotov commented 7 years ago

ok. It sounds reasonable.