I have some old code which uses Vec::drain_filter
a lot. When updated to a newer toolchain, it seems that drain_filter
feature is already removed.
I found no explanation about this in rust’s official documents. However, from this post, I found the drain_filter
has actually equivalent extract_if
. Seems they all accepts some iterator, and filter only the elements which satisfy given predicate.
My question is what makes the difference between drain_filter
and extract_if
and why we removed drain_filter
?