Skip to content

Commit

Permalink
Rollup merge of #90257 - zommiommy:patch-1, r=m-ou-se
Browse files Browse the repository at this point in the history
Changed slice.swap documentation for better readability

The example exchanges the letters "b" and "d", these can be easily confused and are hard to read for people with dyslexia.
Therefore, I changed the example to a more easily readable one.

This is just a small fix and it's not urgent by any means, but I spent 5 minutes trying to understand why I couldn't see any change so I fixed it.

Anyway, thank you for all your works!
  • Loading branch information
GuillaumeGomez authored Oct 25, 2021
2 parents 22b96d6 + 9b28ab4 commit 21b7661
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let mut v = ["a", "b", "c", "d"];
/// v.swap(1, 3);
/// assert!(v == ["a", "d", "c", "b"]);
/// let mut v = ["a", "b", "c", "d", "e"];
/// v.swap(2, 4);
/// assert!(v == ["a", "b", "e", "d", "c"]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand Down

0 comments on commit 21b7661

Please sign in to comment.