about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-10-06 13:18:33 +0200
committerGitHub <noreply@github.com>2023-10-06 13:18:33 +0200
commit4e818f6b72398ff1693b7372b24af0e24a1bc07e (patch)
tree591ec1de275f80b0f7a79ee77945075134e7d689
parentd4ba2b4c7c938cf90c03a265cb31356537f608ad (diff)
parentdfdab8fc629da55ec434d8838daaba9906a61445 (diff)
downloadrust-4e818f6b72398ff1693b7372b24af0e24a1bc07e.tar.gz
rust-4e818f6b72398ff1693b7372b24af0e24a1bc07e.zip
Rollup merge of #115454 - vwkd:patch-1, r=scottmcm
Clarify example in docs of str::char_slice

Just a one word improvement.

“Last” can be misread as meaning the last (third) instead of the previous (first).
-rw-r--r--library/core/src/str/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index eb0c424e2d2..899d572f0e3 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -808,7 +808,7 @@ impl str {
     /// assert_eq!(Some((0, 'y')), char_indices.next()); // not (0, 'y̆')
     /// assert_eq!(Some((1, '\u{0306}')), char_indices.next());
     ///
-    /// // note the 3 here - the last character took up two bytes
+    /// // note the 3 here - the previous character took up two bytes
     /// assert_eq!(Some((3, 'e')), char_indices.next());
     /// assert_eq!(Some((4, 's')), char_indices.next());
     ///