Skip to content

Commit 3697624

Browse files
Rollup merge of #90257 - zommiommy:patch-1, r=m-ou-se
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!
2 parents 6c0dcb4 + 9b28ab4 commit 3697624

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/slice/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@ impl<T> [T] {
553553
/// # Examples
554554
///
555555
/// ```
556-
/// let mut v = ["a", "b", "c", "d"];
557-
/// v.swap(1, 3);
558-
/// assert!(v == ["a", "d", "c", "b"]);
556+
/// let mut v = ["a", "b", "c", "d", "e"];
557+
/// v.swap(2, 4);
558+
/// assert!(v == ["a", "b", "e", "d", "c"]);
559559
/// ```
560560
#[stable(feature = "rust1", since = "1.0.0")]
561561
#[inline]

0 commit comments

Comments
 (0)