From 04f8fb8386c5c4bb7cfdfacbc7c3b4badf13fcf2 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sat, 23 May 2020 08:40:26 +0000 Subject: [PATCH 1/2] doc: Alias skip_while with drop_while --- src/libcore/iter/traits/iterator.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs index 1c3d95cbb8c35..f81943daab7e3 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -942,6 +942,8 @@ pub trait Iterator { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] + #[doc(alias = "drop_while")] + #[doc(alias = "dropwhile")] fn skip_while

(self, predicate: P) -> SkipWhile where Self: Sized, From db7129f4a9b5356ef1e0340617bd5921a4f715af Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 26 May 2020 01:20:24 +0000 Subject: [PATCH 2/2] Use inline doc instead of unusable doc_alias feature --- src/libcore/iter/traits/iterator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/iter/traits/iterator.rs b/src/libcore/iter/traits/iterator.rs index f81943daab7e3..79466497e10be 100644 --- a/src/libcore/iter/traits/iterator.rs +++ b/src/libcore/iter/traits/iterator.rs @@ -889,6 +889,8 @@ pub trait Iterator { /// /// [`skip`]: #method.skip /// + /// *Note: Some languages call this method: "drop_while" or "dropwhile".* + /// /// `skip_while()` takes a closure as an argument. It will call this /// closure on each element of the iterator, and ignore elements /// until it returns `false`. @@ -942,8 +944,6 @@ pub trait Iterator { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] - #[doc(alias = "drop_while")] - #[doc(alias = "dropwhile")] fn skip_while

(self, predicate: P) -> SkipWhile where Self: Sized,