1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/// Consume an iterator.
///
/// This function takes any implementation of [`IntoIterator`],
/// which includes iterators themselves.
///
/// # Example
///
/// The iterator is always fully consumed.
///
/// ```
/// # use consume_iterator::consume;
/// let mut range = 0..=10;
/// consume(&mut range);
/// assert!(range.is_empty());
/// ```
/// Convenience trait to allow using [`consume`] as a method.
/// This trait is implemented for every [`Iterator`].