]> git.lizzy.rs Git - rust.git/commitdiff
Add "or destination" to {copy, clone}_from_slice example
authorAnirudh Balaji <anirudhb@users.noreply.github.com>
Mon, 9 Jul 2018 20:41:46 +0000 (13:41 -0700)
committerGitHub <noreply@github.com>
Mon, 9 Jul 2018 20:41:46 +0000 (13:41 -0700)
src/libcore/slice/mod.rs

index 0ee4c0bdbe7f97f7476575a39bf89fed4faaa606..c41776a14605e50692ceb7ed565fc5f5250683ef 100644 (file)
@@ -1541,8 +1541,8 @@ pub fn rotate_right(&mut self, k: usize) {
     /// let src = [1, 2, 3, 4];
     /// let mut dst = [0, 0];
     ///
-    /// // Note: the slices must be the same length, so you can slice the
-    /// // source to be the same size. Here we slice the source, four elements,
+    /// // Note: the slices must be the same length, so you can slice the source
+    /// // or the destination to be the same size. Here we slice the source, four elements,
     /// // to two, the same size as the destination slice. It *will* panic if we don't do this.
     /// dst.clone_from_slice(&src[2..]);
     ///
@@ -1610,8 +1610,8 @@ pub fn clone_from_slice(&mut self, src: &[T]) where T: Clone {
     /// let src = [1, 2, 3, 4];
     /// let mut dst = [0, 0];
     ///
-    /// // Note: the slices must be the same length, so you can slice the
-    /// // source to be the same size. Here we slice the source, four elements,
+    /// // Note: the slices must be the same length, so you can slice the source
+    /// // or the destination to be the same size. Here we slice the source, four elements,
     /// // to two, the same size as the destination slice. It *will* panic if we don't do this.
     /// dst.copy_from_slice(&src[2..]);
     ///