Add example for iter chain struct
This commit is contained in:
parent
782013564e
commit
676e4f193c
@ -6,6 +6,17 @@ use crate::usize;
|
||||
///
|
||||
/// This `struct` is created by [`Iterator::chain`]. See its documentation
|
||||
/// 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)]
|
||||
#[must_use = "iterators are lazy and do nothing unless consumed"]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
Loading…
Reference in New Issue
Block a user