Skip to content

Commit 18ac26d

Browse files
Rollup merge of #77409 - pickfire:patch-6, r=GuillaumeGomez
Add example for iter chain struct r? @GuillaumeGomez
2 parents 2a09c18 + aea3f8d commit 18ac26d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

library/core/src/iter/adapters/chain.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ use crate::usize;
66
///
77
/// This `struct` is created by [`Iterator::chain`]. See its documentation
88
/// for more.
9+
///
10+
/// # Examples
11+
///
12+
/// ```
13+
/// use std::iter::Chain;
14+
/// use std::slice::Iter;
15+
///
16+
/// let a1 = [1, 2, 3];
17+
/// let a2 = [4, 5, 6];
18+
/// let iter: Chain<Iter<_>, Iter<_>> = a1.iter().chain(a2.iter());
19+
/// ```
920
#[derive(Clone, Debug)]
1021
#[must_use = "iterators are lazy and do nothing unless consumed"]
1122
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)