Rollup merge of #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.
This commit is contained in:
Tyler Mandry 2020-12-10 21:33:14 -08:00 committed by GitHub
commit c0cc91008a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1413,7 +1413,7 @@ impl String {
self.len() == 0
}
/// Splits the string into two at the given index.
/// Splits the string into two at the given byte index.
///
/// Returns a newly allocated `String`. `self` contains bytes `[0, at)`, and
/// the returned `String` contains bytes `[at, len)`. `at` must be on the