Clarify that String::split_at takes a byte index.

This commit is contained in:
Corey Farwell 2020-12-09 13:17:54 -05:00 committed by GitHub
parent fa55f668e5
commit 33ae62c3d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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