未验证 提交 c0cc9100 编写于 作者: T Tyler Mandry 提交者: GitHub

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.
......@@ -1413,7 +1413,7 @@ pub fn is_empty(&self) -> bool {
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册