rust/library/core/src/iter/traits
Diego Ongaro e5fb426a83 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`.
2025-04-13 19:52:34 -07:00
..
accum.rs use diagnostic::on_unimplemented instead 2025-03-30 15:25:47 +02:00
collect.rs update version placeholders 2025-01-08 20:02:18 +01:00
double_ended.rs Remove #[cfg(not(test))] gates in core 2025-03-06 13:21:59 -08:00
exact_size.rs Add a doc note about why Chain is not ExactSizeIterator 2023-02-12 10:37:25 -08:00
iterator.rs docs: Add example to Iterator::take with by_ref 2025-04-13 19:52:34 -07:00
marker.rs Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
mod.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
unchecked_iterator.rs Allow canonicalizing the array::map loop in trusted cases 2023-02-04 16:44:51 -08:00