Skip to content

Suggest retain_mut over retain as Vec::extract_if alternative #140625

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3659,9 +3659,9 @@ impl<T, A: Allocator> Vec<T, A> {
///
/// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating
/// or the iteration short-circuits, then the remaining elements will be retained.
/// Use [`retain`] with a negated predicate if you do not need the returned iterator.
/// Use [`retain_mut`] with a negated predicate if you do not need the returned iterator.
///
/// [`retain`]: Vec::retain
/// [`retain_mut`]: Vec::retain_mut
///
/// Using this method is equivalent to the following code:
///
Expand Down
Loading