From 5cbb27ff90b6685a27492dc2b1a23074e6194f9a Mon Sep 17 00:00:00 2001 From: Paolo Barbolini Date: Sat, 3 May 2025 16:29:22 +0000 Subject: [PATCH] Suggest `retain_mut` over `retain` as `Vec::extract_if` alternative --- library/alloc/src/vec/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 65a83cb98ba6a..72279e12192bc 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3659,9 +3659,9 @@ impl Vec { /// /// 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: ///