提交 311fbc92 编写于 作者: M Matt Brubeck

[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.
上级 b1f8e6fb
...@@ -747,8 +747,8 @@ pub fn split_off(&mut self, at: usize) -> LinkedList<T> { ...@@ -747,8 +747,8 @@ pub fn split_off(&mut self, at: usize) -> LinkedList<T> {
/// Creates an iterator which uses a closure to determine if an element should be removed. /// 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 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, /// If the closure returns false, the element will remain in the list and will not be yielded
/// seeing if it passes the test. /// by the iterator.
/// ///
/// Note that `drain_filter` lets you mutate every element in the filter closure, regardless of /// Note that `drain_filter` lets you mutate every element in the filter closure, regardless of
/// whether you choose to keep or remove it. /// whether you choose to keep or remove it.
......
...@@ -1966,8 +1966,8 @@ pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter> ...@@ -1966,8 +1966,8 @@ pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter>
/// Creates an iterator which uses a closure to determine if an element should be removed. /// 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 true, then the element is removed and yielded.
/// If the closure returns false, it will try again, and call the closure /// If the closure returns false, the element will remain in the vector and will not be yielded
/// on the next element, seeing if it passes the test. /// by the iterator.
/// ///
/// Using this method is equivalent to the following code: /// Using this method is equivalent to the following code:
/// ///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册