about summary refs log tree commit diff
path: root/library/alloc/src/string.rs
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2020-12-10 21:33:14 -0800
committerGitHub <noreply@github.com>2020-12-10 21:33:14 -0800
commitc0cc91008a28a5d09df5302d39cae984bc5c2ec1 (patch)
treed697761a50d60dc3839c5a4aafb7c772b64f10c9 /library/alloc/src/string.rs
parent8709ac81d3047b42757ee616a5bb6662a3a20bff (diff)
parent33ae62c3d7c5a619595e9faced2450dae27ad702 (diff)
downloadrust-c0cc91008a28a5d09df5302d39cae984bc5c2ec1.tar.gz
rust-c0cc91008a28a5d09df5302d39cae984bc5c2ec1.zip
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.
Diffstat (limited to 'library/alloc/src/string.rs')
-rw-r--r--library/alloc/src/string.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index ce216e5336e..27b32b69502 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -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