Lokathor / tinyvec

Just, really the littlest Vec you could need. So smol.
https://docs.rs/tinyvec
Apache License 2.0
648 stars 49 forks source link

retain_mut #195

Closed Fuuzetsu closed 3 months ago

Fuuzetsu commented 3 months ago

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?

Lokathor commented 3 months ago

That function is relatively new is all. Most of this crate was made in like the 1.40-ish era iirc, so newer Vec methods aren't always present.

I'm happy to merge a PR that adds this method.