Skip to content

Commit c90a821

Browse files
authored
Add "or destination" to {copy, clone}_from_slice example
1 parent c95fba7 commit c90a821

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/slice/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,8 @@ 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
1545-
/// // source to be the same size. Here we slice the source, four elements,
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,
15461546
/// // to two, the same size as the destination slice. It *will* panic if we don't do this.
15471547
/// dst.clone_from_slice(&src[2..]);
15481548
///
@@ -1610,8 +1610,8 @@ 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
1614-
/// // source to be the same size. Here we slice the source, four elements,
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,
16151615
/// // to two, the same size as the destination slice. It *will* panic if we don't do this.
16161616
/// dst.copy_from_slice(&src[2..]);
16171617
///

0 commit comments

Comments
 (0)