diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-10-25 16:34:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-25 16:34:54 +0200 |
| commit | 3697624e013f7d117cd46a2b154b89df89a5af83 (patch) | |
| tree | 576016669b416b93052579b35e8a1fecc3bf1106 | |
| parent | 6c0dcb41bd16865b9ace5048243d3ea5a0daf7a5 (diff) | |
| parent | 9b28ab40acd55b5d26b6fcdae75873ea321f696d (diff) | |
| download | rust-3697624e013f7d117cd46a2b154b89df89a5af83.tar.gz rust-3697624e013f7d117cd46a2b154b89df89a5af83.zip | |
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!
| -rw-r--r-- | library/core/src/slice/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index aaa00653b99..a6370a4513b 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -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] |
