Rollup merge of #77409 - pickfire:patch-6, r=GuillaumeGomez
Add example for iter chain struct r? @GuillaumeGomez
This commit is contained in:
commit
18ac26d1c5
@ -6,6 +6,17 @@ use crate::usize;
|
|||||||
///
|
///
|
||||||
/// This `struct` is created by [`Iterator::chain`]. See its documentation
|
/// This `struct` is created by [`Iterator::chain`]. See its documentation
|
||||||
/// for more.
|
/// for more.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use std::iter::Chain;
|
||||||
|
/// use std::slice::Iter;
|
||||||
|
///
|
||||||
|
/// let a1 = [1, 2, 3];
|
||||||
|
/// let a2 = [4, 5, 6];
|
||||||
|
/// let iter: Chain<Iter<_>, Iter<_>> = a1.iter().chain(a2.iter());
|
||||||
|
/// ```
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
#[must_use = "iterators are lazy and do nothing unless consumed"]
|
#[must_use = "iterators are lazy and do nothing unless consumed"]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user