Skip to content

Commit c92cdad

Browse files
committed
Str::slice_chars() is O(end), not O(end - begin)
1 parent 87a31f6 commit c92cdad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1997,8 +1997,8 @@ pub trait StrSlice<'a> {
19971997
/// handle edge cases such as leaving a combining character as the
19981998
/// first code point of the string.
19991999
///
2000-
/// Due to the design of UTF-8, this operation is `O(end -
2001-
/// begin)`. See `slice`, `slice_to` and `slice_from` for `O(1)`
2000+
/// Due to the design of UTF-8, this operation is `O(end)`.
2001+
/// See `slice`, `slice_to` and `slice_from` for `O(1)`
20022002
/// variants that use byte indices rather than code point
20032003
/// indices.
20042004
///

0 commit comments

Comments
 (0)