Changed slice.swap documentation for better readability

using "b" and "d" can be easily confused
This commit is contained in:
Tommaso Fontana 2021-10-25 13:51:34 +02:00 committed by GitHub
parent 32f3887b9b
commit 32a3edb153
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -553,9 +553,9 @@ impl<T> [T] {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// let mut v = ["a", "b", "c", "d"]; /// let mut v = ["a", "b", "c", "d", "e];
/// v.swap(1, 3); /// v.swap(2, 4);
/// assert!(v == ["a", "d", "c", "b"]); /// assert!(v == ["a", "b", "e", "d", "c"]);
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[inline] #[inline]