From 311fbc9265ea1ebe803449c8d7e083f9edf605d9 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Thu, 22 Feb 2018 12:05:30 -0800 Subject: [PATCH] [docs] Minor wording changes to drain_filter docs The docs currently say, "If the closure returns false, it will try again, and call the closure on the next element." But this happens regardless of whether the closure returns true or false. --- src/liballoc/linked_list.rs | 4 ++-- src/liballoc/vec.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/liballoc/linked_list.rs b/src/liballoc/linked_list.rs index 65be087b35e5e..ec579e3fd68d6 100644 --- a/src/liballoc/linked_list.rs +++ b/src/liballoc/linked_list.rs @@ -747,8 +747,8 @@ impl LinkedList { /// Creates an iterator which uses a closure to determine if an element should be removed. /// /// If the closure returns true, then the element is removed and yielded. - /// If the closure returns false, it will try again, and call the closure on the next element, - /// seeing if it passes the test. + /// If the closure returns false, the element will remain in the list and will not be yielded + /// by the iterator. /// /// Note that `drain_filter` lets you mutate every element in the filter closure, regardless of /// whether you choose to keep or remove it. diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 39a4d271bd6fe..3c9b6b94b4405 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1966,8 +1966,8 @@ impl Vec { /// Creates an iterator which uses a closure to determine if an element should be removed. /// /// If the closure returns true, then the element is removed and yielded. - /// If the closure returns false, it will try again, and call the closure - /// on the next element, seeing if it passes the test. + /// If the closure returns false, the element will remain in the vector and will not be yielded + /// by the iterator. /// /// Using this method is equivalent to the following code: ///