A retain_mut function would be very useful. There's one for std::vec::Vec: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain_mut . It's more efficient to use this than to do two loops of modifying the contents and then checking with retain what to remove based on some condition.
I think there's no technical limitation for not having this?
A
retain_mut
function would be very useful. There's one for std::vec::Vec: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.retain_mut . It's more efficient to use this than to do two loops of modifying the contents and then checking withretain
what to remove based on some condition.I think there's no technical limitation for not having this?