Skip to content

Commit 918dbfe

Browse files
committed
auto merge of #14609 : aturon/rust/issue-12882, r=alexcrichton
2 parents eb16646 + 7526a80 commit 918dbfe

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/libcore/str.rs

+17-2
Original file line numberDiff line numberDiff line change
@@ -1475,12 +1475,27 @@ pub trait StrSlice<'a> {
14751475
/// This function can be used to iterate over a unicode string in reverse.
14761476
///
14771477
/// Returns 0 for next index if called on start index 0.
1478+
///
1479+
/// # Failure
1480+
///
1481+
/// If `i` is greater than the length of the string.
1482+
/// If `i` is not an index following a valid UTF-8 character.
14781483
fn char_range_at_reverse(&self, start: uint) -> CharRange;
14791484

1480-
/// Plucks the character starting at the `i`th byte of a string
1485+
/// Plucks the character starting at the `i`th byte of a string.
1486+
///
1487+
/// # Failure
1488+
///
1489+
/// If `i` is greater than or equal to the length of the string.
1490+
/// If `i` is not the index of the beginning of a valid UTF-8 character.
14811491
fn char_at(&self, i: uint) -> char;
14821492

1483-
/// Plucks the character ending at the `i`th byte of a string
1493+
/// Plucks the character ending at the `i`th byte of a string.
1494+
///
1495+
/// # Failure
1496+
///
1497+
/// If `i` is greater than the length of the string.
1498+
/// If `i` is not an index following a valid UTF-8 character.
14841499
fn char_at_reverse(&self, i: uint) -> char;
14851500

14861501
/// Work with the byte buffer of a string as a byte slice.

0 commit comments

Comments
 (0)