diff options
| author | bors <bors@rust-lang.org> | 2017-11-23 21:48:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-11-23 21:48:30 +0000 |
| commit | bbd7932a66b56da9a1c7d8cc30dc931922b356c0 (patch) | |
| tree | f3ed11de96904f08b8166bef2cb96ad0e0c98c77 /src/liballoc | |
| parent | 246a6d19c9844744737876fc55701395ae535579 (diff) | |
| parent | e6968dfa0d58cd4299e9db88ad53ec309fa4192a (diff) | |
| download | rust-bbd7932a66b56da9a1c7d8cc30dc931922b356c0.tar.gz rust-bbd7932a66b56da9a1c7d8cc30dc931922b356c0.zip | |
Auto merge of #46225 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests - Successful merges: #45635, #46177, #46190, #46218, #46220 - Failed merges:
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/slice.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index b41cb912fe7..7e3d2af79ce 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1468,9 +1468,9 @@ impl<T> [T] { core_slice::SliceExt::copy_from_slice(self, src) } - /// Swaps all elements in `self` with those in `src`. + /// Swaps all elements in `self` with those in `other`. /// - /// The length of `src` must be the same as `self`. + /// The length of `other` must be the same as `self`. /// /// # Panics /// @@ -1481,16 +1481,16 @@ impl<T> [T] { /// ``` /// #![feature(swap_with_slice)] /// - /// let mut src = [1, 2, 3]; - /// let mut dst = [7, 8, 9]; + /// let mut slice1 = [1, 2, 3]; + /// let mut slice2 = [7, 8, 9]; /// - /// src.swap_with_slice(&mut dst); - /// assert_eq!(src, [7, 8, 9]); - /// assert_eq!(dst, [1, 2, 3]); + /// slice1.swap_with_slice(&mut slice2); + /// assert_eq!(slice1, [7, 8, 9]); + /// assert_eq!(slice2, [1, 2, 3]); /// ``` #[unstable(feature = "swap_with_slice", issue = "44030")] - pub fn swap_with_slice(&mut self, src: &mut [T]) { - core_slice::SliceExt::swap_with_slice(self, src) + pub fn swap_with_slice(&mut self, other: &mut [T]) { + core_slice::SliceExt::swap_with_slice(self, other) } /// Copies `self` into a new `Vec`. |
