about summary refs log tree commit diff
path: root/tests/rustdoc/source-code-pages/version-separator-without-source.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-01 22:27:20 +0200
committerGitHub <noreply@github.com>2025-05-01 22:27:20 +0200
commit931735a1b102342978c7c43ec037917a05a66db7 (patch)
tree967d54bdc881806384e0cdc7a8b4438800343cb9 /tests/rustdoc/source-code-pages/version-separator-without-source.rs
parentbd68c36ee0414c784ef3ab9488ba8b9d05b9eef2 (diff)
parente5fb426a833e45565f13f81c2c664e77e0e351f1 (diff)
downloadrust-931735a1b102342978c7c43ec037917a05a66db7.tar.gz
rust-931735a1b102342978c7c43ec037917a05a66db7.zip
Rollup merge of #139780 - ongardie:iterator-take-by_ref-example, r=workingjubilee
docs: Add example to `Iterator::take` with `by_ref`

If you want to logically split an iterator after `n` items, you might first discover `take`. Before this change, you'd find that `take` consumes the iterator, and you'd probably be stuck. The answer involves `by_ref`, but that's hard to discover, especially since `by_ref` is a bit abstract and `Iterator` has many methods.

After this change, you'd see the example showing `take` along with `by_ref`, which allows you to continue using the rest of the iterator. `by_ref` had a good example involving `take` already, so this change just duplicates that existing example under `take`.
Diffstat (limited to 'tests/rustdoc/source-code-pages/version-separator-without-source.rs')
0 files changed, 0 insertions, 0 deletions