Skip to content

Commit

Permalink
[docs] Minor wording changes to drain_filter docs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mbrubeck committed Feb 22, 2018
1 parent b1f8e6f commit 311fbc9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/liballoc/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,8 @@ impl<T> LinkedList<T> {
/// 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.
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1966,8 +1966,8 @@ impl<T> Vec<T> {
/// 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:
///
Expand Down

0 comments on commit 311fbc9

Please sign in to comment.