4 ms·
That's not exactly the same. Splice returns an iterator, it doesn't modify the collection in place.
by Measter 6y ago
That's not exactly the same. Splice returns an iterator, it doesn't modify the collection in place.
- Dr_Emann 6y agoYes 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&edition=2018&gist=207a1c4de84ed43608ab774c15c8e5db https://play.rust-lang.org/?version=stable&mode=debug&editio...
- Measter 6y agoHuh... I guess I should read the docs more carefully next time; I clearly misunderstood them.