]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #91383 - ScriptDevil:drop-while-doc-alias, r=joshtriplett
authorYuki Okushi <jtitor@2k36.org>
Tue, 30 Nov 2021 08:29:13 +0000 (17:29 +0900)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 08:29:13 +0000 (17:29 +0900)
Add `drop_while` as doc alias to `Iterator::skip_while`

`skip_while` is commonly referred to as `drop_while` in other languages (clojure/c++/haskell). This recently came up in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.E2.9C.94.20DropWhile/near/262203352) as well.

This pull request adds 'drop_while' as a doc-alias for 'skip_while'.

r? `@joshtriplett`

library/core/src/iter/traits/iterator.rs

index f3ef6b3d0185e3fc1917ba35691fa64605e5b45b..35ce9400f8f4d4ab1496ad87f9ca96c8cf54b8ad 100644 (file)
@@ -1023,6 +1023,7 @@ fn peekable(self) -> Peekable<Self>
     /// assert_eq!(iter.next(), None);
     /// ```
     #[inline]
+    #[doc(alias = "drop_while")]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
     where