Skip to content

Commit

Permalink
Fix iterator copied() documentation example code
Browse files Browse the repository at this point in the history
  • Loading branch information
schteve committed Jun 14, 2020
1 parent 10326d8 commit 5a846d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2717,12 +2717,12 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3];
///
/// let v_cloned: Vec<_> = a.iter().copied().collect();
/// let v_copied: Vec<_> = a.iter().copied().collect();
///
/// // copied is the same as .map(|&x| x)
/// let v_map: Vec<_> = a.iter().map(|&x| x).collect();
///
/// assert_eq!(v_cloned, vec![1, 2, 3]);
/// assert_eq!(v_copied, vec![1, 2, 3]);
/// assert_eq!(v_map, vec![1, 2, 3]);
/// ```
#[stable(feature = "iter_copied", since = "1.36.0")]
Expand Down

0 comments on commit 5a846d7

Please sign in to comment.