Skip to content

Commit dd0338f

Browse files
committed
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' in the doc comments. Thank you for reviewing this PR :)
1 parent f6072ca commit dd0338f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)