Skip to content

Commit 79730d6

Browse files
Rollup merge of rust-lang#106187 - ChayimFriedman2:patch-4, r=compiler-errors
Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())` Another option is to use `extend_from_slice()` (that may be faster), but I find this approach cleaner.
2 parents 4de5547 + 4df5459 commit 79730d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/vec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ mod spec_extend;
166166
/// vec[0] = 7;
167167
/// assert_eq!(vec[0], 7);
168168
///
169-
/// vec.extend([1, 2, 3].iter().copied());
169+
/// vec.extend([1, 2, 3]);
170170
///
171171
/// for x in &vec {
172172
/// println!("{x}");

0 commit comments

Comments
 (0)