Skip to content

Commit 2d4ed2a

Browse files
authored
Rollup merge of #72829 - JOE1994:clarify_terms, r=jonas-schievink
Clarify terms in doc comments Doc comments of `copy_from_slice` say that people should use `clone_from_slice` when 'src' doesn't implement `Copy`. However, 'src' is a reference and it always implements `Copy`. The term 'src' should be fixed to `T`(element type of slice 'src') in the doc comments. Thank you for reviewing this PR :) 😺
2 parents 5480120 + dd0338f commit 2d4ed2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/libcore/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ impl<T> [T] {
21732173
///
21742174
/// The length of `src` must be the same as `self`.
21752175
///
2176-
/// If `src` implements `Copy`, it can be more performant to use
2176+
/// If `T` implements `Copy`, it can be more performant to use
21772177
/// [`copy_from_slice`].
21782178
///
21792179
/// # Panics
@@ -2244,7 +2244,7 @@ impl<T> [T] {
22442244
///
22452245
/// The length of `src` must be the same as `self`.
22462246
///
2247-
/// If `src` does not implement `Copy`, use [`clone_from_slice`].
2247+
/// If `T` does not implement `Copy`, use [`clone_from_slice`].
22482248
///
22492249
/// # Panics
22502250
///

0 commit comments

Comments
 (0)