]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #86111 - spookyvision:master, r=JohnTitor
authorYuki Okushi <jtitor@2k36.org>
Thu, 10 Jun 2021 02:02:14 +0000 (11:02 +0900)
committerGitHub <noreply@github.com>
Thu, 10 Jun 2021 02:02:14 +0000 (11:02 +0900)
fix off by one in `std::iter::Iterator` documentation

the range `(0..10)` is documented as "The even numbers from zero to ten." - should be ".. to nine".

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

index 96b924f6e2ad45b232a3d5ffa3bcec3bcbda29c0..11dea400a46ef6d8fa59fc8f669de85fab4901bf 100644 (file)
@@ -138,7 +138,7 @@ pub trait Iterator {
     /// A more complex example:
     ///
     /// ```
-    /// // The even numbers from zero to ten.
+    /// // The even numbers in the range of zero to nine.
     /// let iter = (0..10).filter(|x| x % 2 == 0);
     ///
     /// // We might iterate from zero to ten times. Knowing that it's five