Skip to content

Commit 4b51484

Browse files
authored
Change wording for {copy, clone}_from_slice
1 parent c90a821 commit 4b51484

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libcore/slice/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1541,9 +1541,9 @@ impl<T> [T] {
15411541
/// let src = [1, 2, 3, 4];
15421542
/// let mut dst = [0, 0];
15431543
///
1544-
/// // Note: the slices must be the same length, so you can slice the source
1545-
/// // or the destination to be the same size. Here we slice the source, four elements,
1546-
/// // to two, the same size as the destination slice. It *will* panic if we don't do this.
1544+
/// // Because the slices have to be the same length,
1545+
/// // we slice the source slice from four elements
1546+
/// // to two. It will panic if we don't do this.
15471547
/// dst.clone_from_slice(&src[2..]);
15481548
///
15491549
/// assert_eq!(src, [1, 2, 3, 4]);
@@ -1610,9 +1610,9 @@ impl<T> [T] {
16101610
/// let src = [1, 2, 3, 4];
16111611
/// let mut dst = [0, 0];
16121612
///
1613-
/// // Note: the slices must be the same length, so you can slice the source
1614-
/// // or the destination to be the same size. Here we slice the source, four elements,
1615-
/// // to two, the same size as the destination slice. It *will* panic if we don't do this.
1613+
/// // Because the slices have to be the same length,
1614+
/// // we slice the source slice from four elements
1615+
/// // to two. It will panic if we don't do this.
16161616
/// dst.copy_from_slice(&src[2..]);
16171617
///
16181618
/// assert_eq!(src, [1, 2, 3, 4]);

0 commit comments

Comments
 (0)