Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SmallVec::extract_if to match Vec::extract_if #360

Open
GnomedDev opened this issue Oct 9, 2024 · 1 comment
Open

Add SmallVec::extract_if to match Vec::extract_if #360

GnomedDev opened this issue Oct 9, 2024 · 1 comment

Comments

@GnomedDev
Copy link

Currently, there exists the unstable Vec method extract_if which can be super useful. If this can be ported to SmallVec, that would be lovely and help with migration.

@mbrubeck
Copy link
Collaborator

mbrubeck commented Oct 9, 2024

Note: This is included in smallvec 2.0, which is currently available as a pre-release alpha version.

smallvec 1 has a similar method drain_filter which can be enabled using an optional Cargo feature:

https://docs.rs/smallvec/1/smallvec/index.html#drain_filter

(You can ignore the warning that the feature is unstable, since smallvec 1 is now in maintenance mode and will be receiving bug fixes only.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants