Skip to content

Commit 9833534

Browse files
authored
Rollup merge of rust-lang#79860 - rust-lang:frewsxcv-patch-2, r=jyn514
Clarify that String::split_at takes a byte index. To someone skimming through the `String` docs and only reads the first line, the person could interpret "index" to be "char index". Later on in the docs it clarifies, but by adding "byte" it removes that ambiguity.
2 parents eb29766 + a8c355f commit 9833534

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ impl String {
14131413
self.len() == 0
14141414
}
14151415

1416-
/// Splits the string into two at the given index.
1416+
/// Splits the string into two at the given byte index.
14171417
///
14181418
/// Returns a newly allocated `String`. `self` contains bytes `[0, at)`, and
14191419
/// the returned `String` contains bytes `[at, len)`. `at` must be on the

0 commit comments

Comments
 (0)