Skip to content

Commit 4e818f6

Browse files
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).
2 parents d4ba2b4 + dfdab8f commit 4e818f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: library/core/src/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ impl str {
808808
/// assert_eq!(Some((0, 'y')), char_indices.next()); // not (0, 'y̆')
809809
/// assert_eq!(Some((1, '\u{0306}')), char_indices.next());
810810
///
811-
/// // note the 3 here - the last character took up two bytes
811+
/// // note the 3 here - the previous character took up two bytes
812812
/// assert_eq!(Some((3, 'e')), char_indices.next());
813813
/// assert_eq!(Some((4, 's')), char_indices.next());
814814
///

0 commit comments

Comments
 (0)