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:
commit
c0cc91008a
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue