Hacker News new | ask | show | jobs
by Measter 1944 days ago
That's not exactly the same. Splice returns an iterator, it doesn't modify the collection in place.
1 comments

Yes it does exactly that. It returns an iterator over the removed items, but when that iterator is dropped, it modifies the collection. See https://play.rust-lang.org/?version=stable&mode=debug&editio...
Huh... I guess I should read the docs more carefully next time; I clearly misunderstood them.