Skip to content

Commit c5a0a73

Browse files
committed
str: Correct documentation on is_char_boundary
Documentation claims it panics on out of bounds -- it regards out of bounds as just not a char boundary. core::str module is aware of how it works and uses it appropriately. Maybe we should rename it to `is_valid_index`, `is_slicable_index`, or something similar.
1 parent 0da6996 commit c5a0a73

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libcollections/str.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,7 @@ impl str {
483483
/// considered to be
484484
/// boundaries.
485485
///
486-
/// # Panics
487-
///
488-
/// Panics if `index` is greater than `self.len()`.
486+
/// Returns `false` if `index` is greater than `self.len()`.
489487
///
490488
/// # Examples
491489
///

0 commit comments

Comments
 (0)