From d504d553f101bd36aebed28122d43e9fcae0b60e Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 29 Aug 2020 18:21:47 +0800 Subject: [PATCH 1/3] Keep doc standard for Vec DrainFilter --- library/alloc/src/vec.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index b4ad238680f79..c024ef7c17db2 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -3026,7 +3026,10 @@ impl Drain<'_, T> { } } -/// An iterator produced by calling `drain_filter` on Vec. +/// A draining iterator with filter predicate for `Vec`. +/// +/// This struct is created by [`Vec::drain_filter()`]. +/// See its documentation for more. #[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")] #[derive(Debug)] pub struct DrainFilter<'a, T, F> From d727442f2d79e746ce0dad2da519bed91ff4ccda Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 29 Aug 2020 18:23:29 +0800 Subject: [PATCH 2/3] Remove brackets in drain filter docs --- library/alloc/src/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index c024ef7c17db2..7be5f97340e66 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -3028,7 +3028,7 @@ impl Drain<'_, T> { /// A draining iterator with filter predicate for `Vec`. /// -/// This struct is created by [`Vec::drain_filter()`]. +/// This struct is created by [`Vec::drain_filter`]. /// See its documentation for more. #[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")] #[derive(Debug)] From be8b5eb529adbb0e62dcc8872918e9c09aba56a4 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 29 Aug 2020 22:39:34 +0800 Subject: [PATCH 3/3] Reuse description from drain_filter Co-authored-by: Joshua Nelson --- library/alloc/src/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 7be5f97340e66..12441ccd41f24 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -3026,7 +3026,7 @@ impl Drain<'_, T> { } } -/// A draining iterator with filter predicate for `Vec`. +/// An iterator which uses a closure to determine if an element should be removed. /// /// This struct is created by [`Vec::drain_filter`]. /// See its documentation for more.