Skip to content

Commit ec101bb

Browse files
committed
docs: update code example for Iterator#try_for_each
1 parent a25032c commit ec101bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2393,7 +2393,7 @@ pub trait Iterator {
23932393
/// let res = data.iter().try_for_each(|x| writeln!(stdout(), "{x}"));
23942394
/// assert!(res.is_ok());
23952395
///
2396-
/// let mut it = data.iter().cloned();
2396+
/// let mut it = data.into_iter();
23972397
/// let res = it.try_for_each(|x| rename(x, Path::new(x).with_extension("old")));
23982398
/// assert!(res.is_err());
23992399
/// // It short-circuited, so the remaining items are still in the iterator:

0 commit comments

Comments
 (0)